Floating Bar
La pastille qui flotte au-dessus de toutes les apps lorsque l’enregistrement est prêt, en cours ou en traitement, avec un bouton de fermeture.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: pas encore disponible
Utilisation
<div class="demo-stack" style="max-width: 420px; width: 100%">
@if (visible()) {
<div style="height: 3rem">
<sone-floating-bar [state]="state()" (closed)="visible.set(false)">
<sone-status-orb [state]="orb()" />
<span>{{ state() === 'live' ? 'Recording · 02:14' : state() === 'processing' ? 'Writing the note…' : 'Ready · ⌘⇧R' }}</span>
</sone-floating-bar>
</div>
} @else {
<button soneBtn variant="outline" type="button" (click)="visible.set(true)">Show the bar</button>
}
<div class="demo-row">
@for (s of states; track s) {
<button soneBtn size="sm" [variant]="state() === s ? 'default' : 'outline'" type="button" (click)="state.set(s)">{{ s }}</button>
}
</div>
</div>Importation
import {
SoneFloatingBarComponent,
} from "@surface-one/angular/floating-bar";Référence de l’API
SoneFloatingBarComponentComposant
| Nom | Type | Par défaut |
|---|---|---|
state | FloatingBarState | "idle" |
closeLabel | — | $localize`:Button that hides the floating recording bar:Hide` |
closableShow the trailing close button. | boolean | true |
dragRegionAttrAn attribute that marks the bar's chrome as the window's drag handle — Tauri's `data-tauri-drag-region`. Set on the bar's own background element, so projected content needs none of its own. `null` = no attribute. | string | null | null |
dragRegionValueThe attribute's value. `deep` (default): Tauri 2.11 drags from anywhere inside the bar except buttons, links, inputs and labels; `""`: the background only. | string | "deep" |
| Nom | Type |
|---|---|
closed | void |