Present contextual content over the current screen. Use it for filters, a queue or a lightweight editor.

Open and close a queue

tsx
import { Button, Sheet, Text, VStack, signal } from 'kuito';

export default function Player() {
  const queueOpen = signal(false);

  return (
    <VStack flex={1} padding={16}>
      <Button onPress={() => (queueOpen.value = true)}>Up next</Button>
      <Sheet open={queueOpen.value} onClose={() => (queueOpen.value = false)} padding={24}>
        <Text>Up next</Text>
      </Sheet>
    </VStack>
  );
}

Behavior

Keep the open state synchronized with native dismissal through a signal or onClose. snapPoints defines permitted heights. Use a presented route when the sheet is a navigable screen or must return a typed result.

Props

Prop Meaning
open Shows the sheet while true. Controlled: set it back to false in onClose.
onClose The user dismissed it (swipe, backdrop or back); set open back to false.
snapPoints Resting heights, smallest first: points, '50%', or 'content' (default).
onSnap { index } of the snap point the sheet settled at.
grabber The drag handle; shown by default.
dismissible Whether swiping down or tapping outside dismisses it; true by default.
borderRadius The sheet's corner radius.
motion sheetMotion(): its height and its progress between its snap points move with the sheet every frame, on the UI thread (follow a sheet).

Continue

Read Navigation for a complete workflow. See the complete prop reference for types and documented defaults.

Référence

Signatures

ts
(props: SheetProps): KuitoElement

Paramètres

NomTypeRequisDescription
propsSheetPropsOui—

Retourne

KuitoElement

Props: SheetProps

Props (props héritées incluses) 103

NomTypeRequisDescription
onClose(event: KuitoEvent<"close">) => voidNonThe user dismissed the sheet (swipe down, backdrop tap or back).
onSnap(event: SnapEvent) => voidNonThe sheet settled at another snap point.
motionSheetMotionNonMoves with the sheet every frame on the UI thread: sheetMotion(), given to one sheet.
opacityAnimatable<number>Non—
backgroundColorAnimatable<string>Non—
borderColorAnimatable<string>Non—
widthAnimatable<SizeValue>Non—
heightAnimatable<SizeValue>Non—
translateXAnimatable<number>Non—
translateYAnimatable<number>Non—
scaleAnimatable<number>Non—
scaleXAnimatable<number>Non—
scaleYAnimatable<number>Non—
rotateAnimatable<number>NonDegrees.
shadowColorAnimatable<string>Non—
shadowRadiusAnimatable<number>Non—
shadowOffsetXAnimatable<number>Non—
shadowOffsetYAnimatable<number>Non—
hiddenProp<boolean>NonTakes the view out of layout and off screen, as CSS display: none.
paddingProp<LengthPercentage>Non—
positionProp<"relative" | "absolute">Non—
childrenKuitoNodeNon—
idstringNon—
refElementRef<ElementHandle>Non—
classProp<ClassNames>NonClass names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads.
styleStyleDeclarationsNonStyles of this view alone, compiled at build time: CSS properties in camelCase. A value that changes must set a native prop (opacity).
onPress(event: PressEvent) => voidNon—
onPressCapture(event: PressEvent) => voidNon—
keystring | numberNon—
paddingTopProp<LengthPercentage>Non—
paddingRightProp<LengthPercentage>Non—
paddingBottomProp<LengthPercentage>Non—
paddingLeftProp<LengthPercentage>Non—
minWidthProp<SizeValue>Non—
maxWidthProp<SizeValue>Non—
minHeightProp<SizeValue>Non—
maxHeightProp<SizeValue>Non—
aspectRatioProp<number>NonWidth divided by height; sizes the missing side from the other.
topProp<LengthPercentageAuto>Non—
rightProp<LengthPercentageAuto>Non—
bottomProp<LengthPercentageAuto>Non—
leftProp<LengthPercentageAuto>Non—
marginProp<LengthPercentageAuto>Non—
marginTopProp<LengthPercentageAuto>Non—
marginRightProp<LengthPercentageAuto>Non—
marginBottomProp<LengthPercentageAuto>Non—
marginLeftProp<LengthPercentageAuto>Non—
flexGrowProp<number>Non—
flexShrinkProp<number>Non—
flexBasisProp<SizeValue | "content">Non—
flexProp<number>NonA grow factor from a zero basis, as CSS flex: n; 0 is inflexible.
alignSelfProp<"auto" | SelfAlignment>Non—
directionProp<"ltr" | "rtl">NonThe way lines run; unset, the parent's, and the app's first language's at the root.
boxSizingProp<"border-box" | "content-box">Non—
paddingInlineStartProp<LengthPercentage>NonPadding on the side lines start from: the left in ltr, the right in rtl.
paddingInlineEndProp<LengthPercentage>NonPadding on the side lines end at: the right in ltr, the left in rtl.
marginInlineStartProp<LengthPercentageAuto>NonMargin on the side lines start from: the left in ltr, the right in rtl.
marginInlineEndProp<LengthPercentageAuto>NonMargin on the side lines end at: the right in ltr, the left in rtl.
insetInlineStartProp<LengthPercentageAuto>Nonleft in ltr, right in rtl.
insetInlineEndProp<LengthPercentageAuto>Nonright in ltr, left in rtl.
roleProp<Role>Non—
onAction(event: AccessibilityActionEvent) => voidNonThe screen reader action taken, by name.
accessibleProp<boolean>NonMakes the view one screen reader element, read as its label or its children's text.
labelProp<string>NonWhat a screen reader says for the view.
hintProp<string>NonWhat happens when the view is activated, read after the label.
aria-hiddenProp<boolean>NonScreen readers skip the view and its subtree.
actionsProp<readonly AccessibilityAction[]>NonActions a screen reader offers; onAction receives the one taken.
liveProp<"off" | "polite" | "assertive">NonARIA's aria-live: announces changes to the view's content, on iOS too.
aria-disabledProp<boolean>Non—
aria-selectedProp<boolean>Non—
aria-checkedProp<boolean | "mixed">Non—
aria-busyProp<boolean>Non—
aria-expandedProp<boolean>Non—
aria-valueminProp<number>Non—
aria-valuemaxProp<number>Non—
aria-valuenowProp<number>Non—
aria-valuetextProp<string>Non—
gesturesreadonly Composable[]NonThe view's gestures; several race unless composed with together or orElse.
transitionPartial<Record<"opacity" | "backgroundColor" | "transform" | "borderRadius" | "borderColor" | "shadow" | "width" | "height" | "all", Animation<unknown> | AnimationSpec>>NonHow the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it.
animatePartial<Record<AnimatableProps, string | number>>NonAnimatable props whose every change moves as transition says; the first value applies at once.
enterEffectNonWhere the view enters from: fade.and(slide.up(12)).
exitProp<Effect>NonWhere the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited.
layoutAnimation<number>NonHow the view moves to a new frame the layout gives it: layout={spring()}.
overflowProp<"visible" | "hidden" | "clip" | "scroll">Nonhidden and scroll clip; as in CSS, either lets a flex item shrink below its content.
borderWidthProp<number>Non—
backgroundGradient{ angle: number; colors: string[];}Non—
colorProp<string>Non—
sharedIdProp<string>NonA view the navigation stack flies to the view with the same sharedId on the screen it pushes or pops to (docs/navigation.md#shared-elements).
alignItemsProp<SelfAlignment>Non—
justifyContentProp<ContentAlignment>Non—
gapProp<LengthPercentage>Non—
rowGapProp<LengthPercentage>Non—
columnGapProp<LengthPercentage>Non—
flexDirectionProp<"row" | "column" | "row-reverse" | "column-reverse">Non—
flexWrapProp<"nowrap" | "wrap" | "wrap-reverse" | "balance">Non—
flexLineCountProp<number>NonThe minimum number of lines a wrapping container breaks into (CSS Flexbox 2).
alignContentProp<ContentAlignment>Non—
keyboardProp<{ avoid?: "none" | "padding" | "position";}>Non—
openBound<boolean>Oui—
snapPointsProp<readonly SnapPoint[]>NonHeights the sheet rests at, smallest first; ['content'] by default.
grabberProp<boolean>NonShows the drag handle; true by default.
dismissibleProp<boolean>NonWhether swiping down or tapping outside dismisses it; true by default.
borderRadiusProp<number>Non—
onClose — signatures de méthode

Signatures

ts
(event: KuitoEvent<"close">): void

Paramètres

NomTypeRequisDescription
eventKuitoEvent<"close">Oui—

Retourne

void

onSnap — signatures de méthode

Signatures

ts
(event: SnapEvent): void

Paramètres

NomTypeRequisDescription
eventSnapEventOui—

Retourne

void

onPress — signatures de méthode

Signatures

ts
(event: PressEvent): void

Paramètres

NomTypeRequisDescription
eventPressEventOui—

Retourne

void

onPressCapture — signatures de méthode

Signatures

ts
(event: PressEvent): void

Paramètres

NomTypeRequisDescription
eventPressEventOui—

Retourne

void

onAction — signatures de méthode

Signatures

ts
(event: AccessibilityActionEvent): void

Paramètres

NomTypeRequisDescription
eventAccessibilityActionEventOui—

Retourne

void

backgroundGradient — champs imbriqués

backgroundGradient champs

NomTypeRequisDescription
anglenumberOui—
colorsstring[]Oui—
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.