Jetpack Compose views under One.Android, drawn by Material 3. Layout
nodes such as Column, Row, Box, cards, chips, and icon buttons take
Compose children; leaves such as Text, Icon, Button, Switch,
TextField, and Slider take none. Controls are controlled: a value, a
change callback, and a revision for external resets.
Reach for these when a screen is Android only and should feel like the
system. Every view throws outside an Android build, including on web, so
keep them in an Android branch or an .android.tsx file.
Each One.Android view renders a Fabric node carrying a Compose node type;
nested nodes form one Compose tree on the Android side. A node inside a
Compose tree styles through composeStyle, which maps to Compose modifiers,
while style applies only at the root of the tree and throws when nested.
Leaves throw when given children. A root with no explicit height measures
its content natively and resizes to fit.
Controls keep their value in a native model with an event count and a
revision, like the iOS controls: native edits report up, JavaScript
acknowledges, and raising revision with a new value resets the control
from the outside. TextField and SyncSwitch bind NativeState handles
so keystrokes and flips converge without a React render.
Shared props
Every node takes these. Nodes also take accessibilityLabel,
accessibilityState, accessibilityValue, and testID.
Props
Type
Description
childrenReactNodeCompose children, on layout nodes.
ReactNode
Compose children, on layout nodes.
accessibilityRoleComposeAccessibilityRolebutton, switch, checkbox, radio, header, text, adjustable, alert, or progressbar.
ComposeAccessibilityRole
button, switch, checkbox, radio, header, text, adjustable, alert, or progressbar.
styleStyleProp<ViewStyle>React Native style, at the root of a Compose tree only.
StyleProp<ViewStyle>
React Native style, at the root of a Compose tree only.
composeStyleComposeStyleCompose modifiers. See below.
ComposeStyle
Compose modifiers. See below.
ComposeStyle
Type
Description
backgroundColorColorValueThe fill behind the node.
ColorValue
The fill behind the node.
foregroundColorColorValueThe content color, such as an icon tint.
ColorValue
The content color, such as an icon tint.
paddingnumberPadding on every side, in dp.
number
Padding on every side, in dp.
paddingTopnumberTop padding, in dp.
number
Top padding, in dp.
paddingRightnumberRight padding, in dp.
number
Right padding, in dp.
paddingBottomnumberBottom padding, in dp.
number
Bottom padding, in dp.
paddingLeftnumberLeft padding, in dp.
number
Left padding, in dp.
widthnumberA fixed width, in dp.
number
A fixed width, in dp.
heightnumberA fixed height, in dp.
number
A fixed height, in dp.
fillMaxWidthbooleanFills the parent width.
boolean
Fills the parent width.
fillMaxHeightbooleanFills the parent height.
boolean
Fills the parent height.
weightnumberA share of the free space in a Row or Column.
number
A share of the free space in a Row or Column.
cornerRadiusnumberRounds the node, in dp.
number
Rounds the node, in dp.
opacitynumberFrom 0 to 1.
number
From 0 to 1.
borderColorColorValueThe border color.
ColorValue
The border color.
borderWidthnumberThe border width, in dp.
number
The border width, in dp.
Column, Row, Box
Column stacks children vertically, Row horizontally, and Box layers
them. FlowRow wraps children across rows. Spacer is a gap: with
composeStyle={{ weight: 1 }} it takes the free space in a Row or
Column; with width or height it is fixed. Any other direct child
takes a positive weight the same way.
enabledbooleanfalse dims the button and ignores taps.
boolean
false dims the button and ignores taps.
colorsComposeIconButtonColorsContainer and content colors, enabled and disabled.
ComposeIconButtonColors
Container and content colors, enabled and disabled.
FloatingActionButton, SmallFloatingActionButton, and
LargeFloatingActionButton take an Icon in their .Icon slot.
ExtendedFloatingActionButton also takes Text in .Text, and expanded
shows or hides its text.
import { One } from'one'
functionAddButton({ add }: { add: () =>void }) {
return (
<One.Android.FloatingActionButtononClick={add}>
<One.Android.FloatingActionButton.Icon>
<One.Android.Iconname="add" />
</One.Android.FloatingActionButton.Icon>
</One.Android.FloatingActionButton>
)
}
FloatingActionButton
Type
Description
children (required)ReactNodeThe .Icon and, when extended, .Text slots.
ReactNode
The .Icon and, when extended, .Text slots.
containerColorColorValueThe button color. The theme when unset.
ColorValue
The button color. The theme when unset.
onClick() => voidRuns when tapped.
() => void
Runs when tapped.
ExtendedFloatingActionButton
Type
Description
expandedbooleanShows or hides the text.
boolean
Shows or hides the text.
ToggleButton, IconToggleButton, FilledIconToggleButton, and
OutlinedIconToggleButton are the Material 3 toggles.
children (required)ReactNodeThe content, such as an Icon.
ReactNode
The content, such as an Icon.
checked (required)booleanWhether the toggle is on.
boolean
Whether the toggle is on.
onCheckedChange(checked: boolean) => voidA tap, with the new value.
(checked: boolean) => void
A tap, with the new value.
enabledboolean = truefalse dims the toggle and ignores taps.
boolean = true
false dims the toggle and ignores taps.
colorsComposeToggleButtonColorsContainer and content colors, normal, checked, and disabled.
ComposeToggleButtonColors
Container and content colors, normal, checked, and disabled.
revisionnumber = 0Increase with a new checked to reset it from outside.
number = 0
Increase with a new checked to reset it from outside.
Segmented buttons
SingleChoiceSegmentedButtonRow and MultiChoiceSegmentedButtonRow hold
SegmentedButton children. In a single choice row, pass selected and
onClick; in a multiple choice row, pass checked and onCheckedChange.
Card, ElevatedCard, and OutlinedCard wrap children in the Material 3
card surfaces. ElevatedCard takes no border. Without one, Card has no
border and OutlinedCard uses the theme outline.
elevationnumberThe shadow depth in dp. Zero or more.
number
The shadow depth in dp. Zero or more.
borderComposeCardBorder{ width, color }, width in dp, 1 by default.
ComposeCardBorder
{ width, color }, width in dp, 1 by default.
Surface is a Material 3 surface. Round it with
composeStyle.cornerRadius. With onClick it is clickable, with selected
and onClick selectable, and with checked and onCheckedChange toggleable.
tonalElevationnumberTints the surface by depth, in dp.
number
Tints the surface by depth, in dp.
shadowElevationnumberThe shadow depth, in dp.
number
The shadow depth, in dp.
borderComposeCardBorder{ width, color }.
ComposeCardBorder
{ width, color }.
enabledboolean = truefalse ignores taps.
boolean = true
false ignores taps.
selectedbooleanMakes it selectable, with onClick.
boolean
Makes it selectable, with onClick.
checkedbooleanMakes it toggleable, with onCheckedChange.
boolean
Makes it toggleable, with onCheckedChange.
onClick() => voidRuns when tapped.
() => void
Runs when tapped.
onCheckedChange(checked: boolean) => voidA tap, with the new checked value.
(checked: boolean) => void
A tap, with the new checked value.
revisionnumber = 0Increase with a new checked to reset it from outside.
number = 0
Increase with a new checked to reset it from outside.
ListItem
ListItem is a Material 3 row. Put Compose content in its
.HeadlineContent slot, and optionally .OverlineContent,
.SupportingContent, .LeadingContent, and .TrailingContent.
import { One } from'one'
functionInboxRow() {
return (
<One.Android.ListItem>
<One.Android.ListItem.HeadlineContent>
<One.Android.Texttext="Hello" />
</One.Android.ListItem.HeadlineContent>
<One.Android.ListItem.SupportingContent>
<One.Android.Texttext="Preview" />
</One.Android.ListItem.SupportingContent>
</One.Android.ListItem>
)
}
Props
Type
Description
colorsComposeListItemColorsContainer and per slot content colors.
ComposeListItemColors
Container and per slot content colors.
tonalElevationnumberTints the row by depth, in dp.
number
Tints the row by depth, in dp.
shadowElevationnumberThe shadow depth, in dp.
number
The shadow depth, in dp.
Dividers
HorizontalDivider and VerticalDivider draw Material 3 lines. Give a
vertical divider a height through its parent or composeStyle.
import { One } from'one'
functionSplit() {
return (
<One.Android.Column>
<One.Android.Texttext="Above" />
<One.Android.HorizontalDivider />
<One.Android.Texttext="Below" />
</One.Android.Column>
)
}
Props
Type
Description
thicknessnumberThe line width in dp.
number
The line width in dp.
colorColorValueThe line color. The theme when unset.
ColorValue
The line color. The theme when unset.
Badges
Badge is a dot, or a count when it has Compose children. BadgedBox
puts a Badge from its .Badge slot at the top end of its content; with
no slot it shows a dot.
import { One } from'one'
functionInboxIcon() {
return (
<One.Android.BadgedBox>
<One.Android.BadgedBox.Badge>
<One.Android.Badge>
<One.Android.Texttext="3" />
</One.Android.Badge>
</One.Android.BadgedBox.Badge>
<One.Android.Iconname="home" />
</One.Android.BadgedBox>
)
}
Badge
Type
Description
containerColorColorValueThe badge color.
ColorValue
The badge color.
contentColorColorValueThe count color.
ColorValue
The count color.
Chips
AssistChip, FilterChip, InputChip, and SuggestionChip are the
Material 3 chips. Each takes its label in a .Label slot: AssistChip and
FilterChip also have .LeadingIcon and .TrailingIcon, InputChip has
.Avatar and .TrailingIcon, and SuggestionChip has .Icon. Every chip
takes enabled, onClick, elevation in dp, border ({ width, color }),
and colors. A tap calls onClick; set the next selected yourself.
DatePicker is the Material 3 calendar and TimePicker is the clock dial.
Both are controlled by a Date. DatePicker changes the calendar day in the
device time zone and keeps the time of day. TimePicker changes the hour and
minute, keeps the day, and sets seconds to zero.
onSelectionChange (required)(value: Date) => voidA tapped or typed day, with the time of day kept.
(value: Date) => void
A tapped or typed day, with the time of day kept.
revisionnumber = 0Increase with a new value to reset it from outside.
number = 0
Increase with a new value to reset it from outside.
minimumDateDateThe earliest selectable day. Earlier days and years are disabled.
Date
The earliest selectable day. Earlier days and years are disabled.
maximumDateDateThe latest selectable day.
Date
The latest selectable day.
variant'picker' | 'input' = 'picker'The calendar grid or a text field.
'picker' | 'input' = 'picker'
The calendar grid or a text field.
showModeToggleboolean = trueShows the button that switches variant.
boolean = true
Shows the button that switches variant.
colorColorValueTints the title, headline, selected day, and today border.
ColorValue
Tints the title, headline, selected day, and today border.
colorsComposeDatePickerColorsPer-element colors; these win over color.
ComposeDatePickerColors
Per-element colors; these win over color.
TimePicker
Type
Description
selection (required)DateThe selected time of day.
Date
The selected time of day.
onSelectionChange (required)(value: Date) => voidA new hour or minute, with the day kept.
(value: Date) => void
A new hour or minute, with the day kept.
revisionnumber = 0Increase with a new value to reset it from outside.
number = 0
Increase with a new value to reset it from outside.
is24HourbooleanA 24 hour clock. Defaults to the device setting.
boolean
A 24 hour clock. Defaults to the device setting.
variant'picker' | 'input' = 'picker'The clock dial or hour and minute fields.
'picker' | 'input' = 'picker'
The clock dial or hour and minute fields.
colorColorValueTints the selector, selected field, and dial.
ColorValue
Tints the selector, selected field, and dial.
colorsComposeTimePickerColorsPer-element colors; these win over color.
ComposeTimePickerColors
Per-element colors; these win over color.
DatePickerDialog and TimePickerDialog take the same props without
onSelectionChange and revision. Each opening starts from selection; the
confirm button reports the chosen value.
import { useState } from'react'
import { One } from'one'
functionPickDay() {
const [open, setOpen] =useState(false)
const [day, setDay] =useState(() =>newDate())
return (
<>
<One.Android.Buttonlabel="Pick a day"onPress={() =>setOpen(true)} />
{open ? (
<One.Android.DatePickerDialog
selection={day}
visible={open}
onConfirm={(value) => {
setDay(value)
setOpen(false)
}}
onDismiss={() =>setOpen(false)}
/>
) :null}
</>
)
}
DatePickerDialog, TimePickerDialog
Type
Description
visible (required)booleanWhether the dialog shows.
boolean
Whether the dialog shows.
onConfirm (required)(value: Date) => voidThe confirm button, with the chosen value.
(value: Date) => void
The confirm button, with the chosen value.
onDismiss (required)() => voidDismissed by the button, a tap outside, or back.
() => void
Dismissed by the button, a tap outside, or back.
confirmLabelstringThe confirm button title. Defaults to the system OK.
string
The confirm button title. Defaults to the system OK.
dismissLabelstringThe dismiss button title. Defaults to the system Cancel.
string
The dismiss button title. Defaults to the system Cancel.
Date ranges
DateRangePicker and DateRangePickerDialog take optional
initialStartDate and initialEndDate ISO strings. Omit both for an empty
selection, or omit the end for a partial range. An end requires a start and
must fall on or after it. Dates are calendar days at UTC midnight.
selectableDates={{ start, end }} takes optional Date bounds that the
initial selection must fall within.
Both take variant (picker or input), showVariantToggle, showTitle,
showHeadline (all default true), color, and elementColors with the
DatePicker color keys. onDateRangeSelected({ start, end }) receives
Date | null per endpoint. The inline picker reports its initial range and
each change; the dialog reports only a confirmed complete range, needs
onDismissRequest, and mounts to present. An incomplete selection disables
confirmation.
dismissLabelstringThe dismiss button title. No button when unset.
string
The dismiss button title. No button when unset.
onConfirm (required)() => voidThe confirm button was tapped.
() => void
The confirm button was tapped.
onDismiss (required)() => voidDismissed by the button, a tap outside, or back.
() => void
Dismissed by the button, a tap outside, or back.
Dialog
Type
Description
visible (required)booleanWhether the dialog shows.
boolean
Whether the dialog shows.
onDismiss (required)() => voidA tap outside or back asked to close it.
() => void
A tap outside or back asked to close it.
BasicAlertDialog mounts a Material 3 dialog while it is in the React
tree. Its optional onDismissRequest reports back or outside taps; remove
the component to close it. Unlike Dialog, it takes no visible prop.
ProgressIndicator is circular unless variant says otherwise.
LinearProgressIndicator, CircularProgressIndicator,
LinearWavyProgressIndicator, and CircularWavyProgressIndicator fix the
variant. Leave progress unset for an indeterminate indicator.
variantComposeProgressVariant = "circular"linear, circular, linearWavy, or circularWavy.
ComposeProgressVariant = "circular"
linear, circular, linearWavy, or circularWavy.
progressnumber | nullFrom 0 to 1. Unset spins.
number | null
From 0 to 1. Unset spins.
colorColorValueThe indicator color.
ColorValue
The indicator color.
trackColorColorValueThe track color.
ColorValue
The track color.
strokeCapComposeProgressStrokeCapround, butt, or square. Linear and circular.
ComposeProgressStrokeCap
round, butt, or square. Linear and circular.
gapSizenumberThe gap between indicator and track, in dp.
number
The gap between indicator and track, in dp.
strokeWidthnumberThe line width, in dp. Circular.
number
The line width, in dp. Circular.
drawStopIndicatorComposeProgressStopIndicatorThe end dot of a determinate linear bar: { color, strokeCap, stopSize }.
ComposeProgressStopIndicator
The end dot of a determinate linear bar: { color, strokeCap, stopSize }.
stopSizenumberThe end dot size, in dp. Linear wavy.
number
The end dot size, in dp. Linear wavy.
amplitudenumberThe wave height. Wavy.
number
The wave height. Wavy.
wavelengthnumberThe wave length, in dp. Wavy.
number
The wave length, in dp. Wavy.
waveSpeednumberHow fast the wave moves. Wavy.
number
How fast the wave moves. Wavy.
LoadingIndicator and ContainedLoadingIndicator are the Material 3
expressive loading shapes, with progress and color; the contained one
adds containerColor.
LazyColumn scrolls children vertically and LazyRow horizontally.
Children become lazy items: only the visible window composes, so long lists
stay cheap. Give the list a bounded height (column) or width (row); items
size themselves.
verticalArrangementComposeVerticalArrangement | Readonly<{ spacedBy: number }>A preset, or { spacedBy } for a gap in dp.
ComposeVerticalArrangement | Readonly<{ spacedBy: number }>
A preset, or { spacedBy } for a gap in dp.
horizontalAlignment'start' | 'end' | 'center' = 'start'How items sit across the column.
'start' | 'end' | 'center' = 'start'
How items sit across the column.
contentPaddingComposeLazyContentPaddingInset around the items, in dp.
ComposeLazyContentPadding
Inset around the items, in dp.
LazyRow
Type
Description
horizontalArrangementComposeHorizontalArrangement | Readonly<{ spacedBy: number }>A preset, or { spacedBy } for a gap in dp.
ComposeHorizontalArrangement | Readonly<{ spacedBy: number }>
A preset, or { spacedBy } for a gap in dp.
verticalAlignment'top' | 'bottom' | 'center' = 'top'How items sit across the row.
'top' | 'bottom' | 'center' = 'top'
How items sit across the row.
contentPaddingComposeLazyContentPaddingInset around the items, in dp.
ComposeLazyContentPadding
Inset around the items, in dp.
LazyContentPadding
Type
Description
startnumberLeading inset, in dp.
number
Leading inset, in dp.
topnumberTop inset, in dp.
number
Top inset, in dp.
endnumberTrailing inset, in dp.
number
Trailing inset, in dp.
bottomnumberBottom inset, in dp.
number
Bottom inset, in dp.
Image
Image draws a bundled asset or a URI through Compose. Size it with
composeStyle width and height; the bitmap scales inside those bounds.
import { useState } from'react'
import { One } from'one'
functionPhoto({ fileUri }: { fileUri:string }) {
const [loaded, setLoaded] =useState(false)
return (
<One.Android.Image
source={{ uri: fileUri }}
contentScale="crop"
contentDescription="A mountain at sunset"
composeStyle={{ width: 160, height: 100 }}
onLoad={() =>setLoaded(true)}
onError={(error) => console.log(error, loaded)}
/>
)
}
Image
Type
Description
source (required)ComposeImageSourceA bundled asset id or { uri }.
ComposeImageSource
A bundled asset id or { uri }.
contentScaleComposeImageContentScale = 'fit'fit, crop, fillBounds, fillWidth, fillHeight, inside, or none.
ComposeImageContentScale = 'fit'
fit, crop, fillBounds, fillWidth, fillHeight, inside, or none.
alignmentComposeContentAlignment = 'center'Where the image sits inside its bounds.
ComposeContentAlignment = 'center'
Where the image sits inside its bounds.
contentDescriptionstring | nullSpoken to screen readers. Null marks a decorative image.
string | null
Spoken to screen readers. Null marks a decorative image.
tintColorValueA color applied to every non-transparent pixel.
ColorValue
A color applied to every non-transparent pixel.
alphanumberOpacity, from 0 to 1.
number
Opacity, from 0 to 1.
onLoad() => voidThe image decoded and drew.
() => void
The image decoded and drew.
onError(message: string) => voidThe image failed to load, with the reason.
(message: string) => void
The image failed to load, with the reason.
Snackbar
SnackbarHost shows Material 3 snackbars. Its ref exposes
showSnackbar, which resolves 'actionPerformed' when the user taps the
action and 'dismissed' when the snackbar times out or is dismissed. Calls
queue behind the visible snackbar. A Snackbar child styles the shown
snackbars.
import { useRef } from'react'
import { One, type ComposeSnackbarHostRef } from'one'
actionOnNewLineboolean = falsePuts a long action label under the message.
boolean = false
Puts a long action label under the message.
SnackbarShowOptions
Type
Description
message (required)stringThe message body.
string
The message body.
actionLabelstringThe action button label. No button when unset.
string
The action button label. No button when unset.
withDismissActionboolean = falseShows a trailing close button.
boolean = false
Shows a trailing close button.
durationComposeSnackbarDurationshort, long, or indefinite. Short without an action, indefinite with one.
ComposeSnackbarDuration
short, long, or indefinite. Short without an action, indefinite with one.
ModalBottomSheet
ModalBottomSheet presents its children in a Material 3 modal sheet.
Mounting shows it; onDismissRequest fires on a swipe, back press, or
scrim tap, and the parent unmounts it. The ref hides the sheet with an
animation through hide, which resolves when the sheet is hidden.
import { useRef, useState } from'react'
import { One, type ComposeModalBottomSheetRef } from'one'
NavigationBar is the Material 3 bottom bar. Its children are
NavigationBarItem destinations, which spread evenly across the bar. The
parent owns selection: each item reports selected, and onClick moves it.
SearchBar is the Material 3 search field. query is controlled text,
expanded opens the results list, and children render as the expanded
content. onSearch fires when the user submits the query. Leading and
trailing icons go in slots; the M3 pattern swaps the leading search icon for
a back arrow while expanded. DockedSearchBar shares the same props, and
its results anchor under the field instead of taking the screen.
onQueryChange (required)(value: string) => voidThe text changed.
(value: string) => void
The text changed.
revisionnumberBump to force the native text to the query.
number
Bump to force the native text to the query.
expanded (required)booleanThe results list is open.
boolean
The results list is open.
onExpandedChange (required)(expanded: boolean) => voidA tap or back press asked to expand or collapse.
(expanded: boolean) => void
A tap or back press asked to expand or collapse.
expandedRevisionnumberBump to force native expansion to expanded.
number
Bump to force native expansion to expanded.
placeholderstringThe hint shown when the query is empty.
string
The hint shown when the query is empty.
enabledboolean = trueA disabled bar ignores input.
boolean = true
A disabled bar ignores input.
onSearch(query: string) => voidThe user submitted the query.
(query: string) => void
The user submitted the query.
containerColorColorValueThe bar background.
ColorValue
The bar background.
DropdownMenu, ExposedDropdownMenuBox
DropdownMenu is the Material 3 popup menu. Put it beside its anchor in a
Box; its children are DropdownMenuItem rows. The parent owns expansion:
expanded opens it, and onDismissRequest fires on an outside tap or back
press. ExposedDropdownMenuBox is the anchored text-field form: a read-only
field shows value, tapping it opens the same items, and picking one
usually writes the value and collapses.
onExpandedChange (required)(expanded: boolean) => voidA tap, outside tap, or back press asked to expand or collapse.
(expanded: boolean) => void
A tap, outside tap, or back press asked to expand or collapse.
expandedRevisionnumberBump to force native expansion to expanded.
number
Bump to force native expansion to expanded.
value (required)stringThe read-only text in the field.
string
The read-only text in the field.
placeholderstringThe hint shown when the value is empty.
string
The hint shown when the value is empty.
enabledboolean = trueA disabled box ignores taps.
boolean = true
A disabled box ignores taps.
PullToRefreshBox
PullToRefreshBox wraps scrollable children with the Material 3 pull
gesture and indicator. A pull past the threshold calls onRefresh; the
parent keeps isRefreshing true until its reload finishes. Give the box a
bounded height so its list can scroll.
AnimatedVisibility fades and resizes its children in and out as visible
changes. enter and exit pick one transition each; unset, both use the
Material fade with a vertical resize.
enterComposeAnimatedVisibilityTransitionfade, scale, slideVertically, or expandVertically.
ComposeAnimatedVisibilityTransition
fade, scale, slideVertically, or expandVertically.
exitComposeAnimatedVisibilityTransitionfade, scale, slideVertically, or expandVertically. The slide and expand forms shrink on exit.
ComposeAnimatedVisibilityTransition
fade, scale, slideVertically, or expandVertically. The slide and expand forms shrink on exit.
Material carousels
HorizontalCenteredHeroCarousel takes optional maxItemWidth,
minSmallItemWidth, and maxSmallItemWidth.
HorizontalMultiBrowseCarousel takes a required preferredItemWidth with
optional small widths. HorizontalUncontainedCarousel takes a required
itemWidth. Each direct Compose child is an item. All three take
itemSpacing (dp, zero by default), contentPadding (dp or
{ start, top, end, bottom }), flingBehavior (singleAdvance or
noSnap), and userScrollEnabled (default true). Hero and multi-browse
default to single-item snapping; uncontained defaults to free scrolling.
Widths must be positive, and spacing and padding must be nonnegative. Use a
finite height for the carousel.
children (required)ReactNodeOne item per direct Compose child.
ReactNode
One item per direct Compose child.
itemSpacingnumberThe gap between items, in dp.
number
The gap between items, in dp.
contentPaddingnumber | ComposeLazyContentPaddingInset around the items, in dp.
number | ComposeLazyContentPadding
Inset around the items, in dp.
flingBehavior'singleAdvance' | 'noSnap'Single-item snapping or free scrolling.
'singleAdvance' | 'noSnap'
Single-item snapping or free scrolling.
userScrollEnabledbooleanWhether swipes scroll the carousel.
boolean
Whether swipes scroll the carousel.
HeroCarousel
Type
Description
maxItemWidthnumberThe widest a large item may be, in dp.
number
The widest a large item may be, in dp.
minSmallItemWidthnumberThe narrowest a small item may be, in dp.
number
The narrowest a small item may be, in dp.
maxSmallItemWidthnumberThe widest a small item may be, in dp.
number
The widest a small item may be, in dp.
MultiBrowseCarousel
Type
Description
preferredItemWidth (required)numberThe item width, in dp.
number
The item width, in dp.
UncontainedCarousel
Type
Description
itemWidth (required)numberThe item width, in dp.
number
The item width, in dp.
Floating toolbar
HorizontalFloatingToolbar lays out Compose children in a Material
toolbar. variant is standard (default) or vibrant. Put the optional
FAB content inside HorizontalFloatingToolbar.FloatingActionButton.
colorsReadonly<{ toolbarContainerColor?: ColorValue toolbarContentColor?: ColorValue fabContainerColor?: ColorValue fabContentColor?: ColorValue }>Toolbar and FAB colors. Unset fields use the variant defaults.
Toolbar and FAB colors. Unset fields use the variant defaults.
FloatingActionButton
Type
Description
children (required)ReactNodeThe FAB content.
ReactNode
The FAB content.
onPress() => voidRuns when tapped.
() => void
Runs when tapped.
Shapes
One.Android.Shape provides Star, PillStar, Pill, Circle,
Rectangle, Polygon, and RoundedCorner. Shapes are leaves; give them
explicit size through style at the root or composeStyle inside a tree.
color defaults to transparent. cornerRounding, smoothing,
innerRadius, and radius are fractions from zero to one, all defaulting
to zero; verticesCount is an integer of at least three (default six). Set
radius={1} for a full-size circle or star. Stars use the two radii;
polygons use the vertex count; Pill uses smoothing; Circle uses radius and
vertex count; Rectangle uses corner rounding and smoothing. RoundedCorner
uses cornerRadii={{ topStart, topEnd, bottomStart, bottomEnd }} in dp,
with omitted corners zero; logical corners follow layout direction.
verticesCountnumberPolygon vertices. An integer of at least three.
number
Polygon vertices. An integer of at least three.
innerRadiusnumberThe star inner radius, from 0 to 1.
number
The star inner radius, from 0 to 1.
radiusnumberThe outer radius, from 0 to 1.
number
The outer radius, from 0 to 1.
cornerRadiiReadonly<{ topStart?: number topEnd?: number bottomStart?: number bottomEnd?: number }>RoundedCorner radii in dp.
Readonly<{ topStart?: number topEnd?: number bottomStart?: number bottomEnd?: number }>
RoundedCorner radii in dp.
colorColorValueThe fill. Transparent when unset.
ColorValue
The fill. Transparent when unset.
Synchronous switches
SyncSwitch takes isOn={state} from useNativeState(false), optional
enabled (default true), and optional onCheckedChangeSync. The callback
must contain the 'worklet' directive. Native Compose reads and writes the
shared boolean directly; all bound switches observe the same entry. The
callback runs synchronously on the worklets UI runtime after a native
change. Programmatic writes and disabled switches do not invoke it. The
existing Switch remains the scalar isOn/onIsOnChange control.