# @yasinsensoy/native 0.1.0 React Native (Android and iOS) components with the same API and look as @yasinsensoy/web; no extra dependencies. `@yasinsensoy/native`: React Native (Android and iOS) components. The same API, the same theme tokens and the same names as `@yasinsensoy/web` (web); the same look on both platforms. No extra dependencies: icons are drawn with the library's own native drawing view. Each component folder has its own subpath (`@yasinsensoy/native/button`, `/text-field`, `/theme`…). Metro does not drop unused exports (no tree shaking). So add the Babel plugin; it rewrites root imports to subpaths at build time and only the used components go into the bundle (`npx yasinsensoy-native init` adds it itself): ```js // babel.config.js module.exports = { presets: ["module:@react-native/babel-preset"], plugins: ["@yasinsensoy/native/babel"], }; ``` Without the plugin the same result is achieved by importing from subpaths: `import { Button } from "@yasinsensoy/native/button"`. This file is generated from the TSDoc comments in the source code. ## Accordion ### Accordion _component_ Collapsible sections (FAQ, settings groups). Height is animated; the content of closed sections keeps its state. ```tsx 1-3 business days. }, { value: "returns", title: "How do I return an item?", content: }, ]} /> ``` ### AccordionItem _type_ A section inside `Accordion`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `value?` | `string` | | Unique value of the section; defaults to its index. | | `title` | `ReactNode` | | Text in the header row. | | `description?` | `ReactNode` | | Small description below the title. | | `icon?` | `IconProp` | | Icon at the start of the header. | | `content` | `ReactNode` | | Content shown while the section is open. | | `disabled?` | `boolean` | | Cannot be opened. | ### AccordionVariant _type_ Look of the sections: `line` with dividers between them, `card` each in its own box. ```ts type AccordionVariant = "line" | "card" ``` ### AccordionProps _type_ Props of `Accordion`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `items` | `readonly AccordionItem[]` | | Sections. | | `exclusive?` | `boolean` | `false` | Only one section stays open at a time. | | `defaultValue?` | `string \| readonly string[]` | | Value of the initially open section(s). | | `value?` | `readonly string[]` | | Open sections (controlled). | | `onValueChange?` | `(value: string[]) => void` | | When the open sections change. | | `variant?` | `AccordionVariant \| (string & {})` | `"line"` | Variant: one of the built-in variants or a name added via `appearance.variants.accordion` (applied to each section). | | `effect?` | `EffectProp` | | Effect of the sections (`"ripple"`, `"lift"`…). Defaults to `appearance.defaults.accordion.effect`. See `BuiltinEffect`. | | `style?` | `StyleProp` | | Container style. | ## Alert ### Alert _component_ In-page alert: info, success, warning or error. Screen readers read it immediately for `danger`/`warning` tones, in turn for the others. ```tsx Check your card details. Upgrade} /> ``` ### AlertVariant _type_ Alert style: `outline` bordered card, `soft` tinted background. ```ts type AlertVariant = "outline" | "soft" ``` ### AlertProps _type_ Props of `Alert`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `tone?` | `Tone` | `"neutral"` (or `appearance.defaults.alert.tone`)` | Color and default icon. | | `variant?` | `AlertVariant \| (string & {})` | `"outline"` | Variant: one of the built-in variants or a name added via `appearance.variants.alert`. | | `effect?` | `EffectProp` | | Effect or effects (`"beam"`, `"shine"`…). Defaults to `appearance.defaults.alert.effect`. See `BuiltinEffect`. | | `title?` | `ReactNode` | | Title. | | `children?` | `ReactNode` | | Description. | | `icon?` | `IconProp` | | Icon; defaults to the tone's icon, `false` for none. | | `action?` | `ReactNode` | | Action on the right (below on narrow screens), e.g. a button. | | `onClose?` | `() => void` | | When given, a close (×) button appears at the top right. | | `style?` | `StyleProp` | | Container style. | ## Autocomplete ### Autocomplete _component_ Text box that filters suggestions as you type. Uses the same options, list and loading modes as `Select`. - Since the keyboard stays open, suggestions open right below the box in the page flow (not a bottom sheet); rows are thumb-sized. - With `allowCustomValue` text not in the list also becomes a value; the keyboard's "Done/Enter" adds it. - With `multiple` selected items become tags in the box; removed with ✕. ```tsx ``` ### SingleAutocompleteProps _type_ Single selection. Also accepts the properties of: `FieldProps` | Property | Type | Default | Description | | --- | --- | --- | --- | | `multiple?` | `false` | | Single selection. | | `value?` | `string` | | Selected value (controlled). | | `defaultValue?` | `string` | | Initial value. | | `onValueChange?` | `(value: string, item: SelectItem \| undefined) => void` | | When the selection changes. | | `items?` | `SelectItemsSource` | | Suggestions: an array, a Promise or a function called once. | | `loadItems?` | `SelectLoader` | | Function that searches and paginates on the server. | | `allowCustomValue?` | `boolean` | `false` | Text not in the list also becomes a value (tags, email recipients). | | `openOnFocus?` | `boolean` | `false` | Should the list open on focus (without typing)? | | `inputValue?` | `string` | | Text in the box, for controlled use. | | `onInputChange?` | `(text: string) => void` | | When the text in the box changes. | | `placeholder?` | `string` | | Placeholder. | | `emptyMessage?` | `ReactNode` | | When there are no suggestions. | | `icon?` | `IconProp` | | Icon at the start of the box. | | `clearable?` | `boolean` | `true` | Clear button. | | `open?` | `boolean` | | Whether the list is open, for controlled use. | | `onOpenChange?` | `(open: boolean) => void` | | When the list opens or closes. | | `variant?` | `FieldVariant` | `"outline"` | Field variant. | | `aria-label?` | `string` | | Screen reader name; give it if there is no visible `label`. | | `style?` | `StyleProp` | | Container style. | ### MultiAutocompleteProps _type_ Multiple selection: selected items become tags in the box. Also accepts the properties of: `FieldProps` | Property | Type | Default | Description | | --- | --- | --- | --- | | `multiple` | `true` | | Multiple selection. | | `value?` | `readonly string[]` | | Selected values (controlled). | | `defaultValue?` | `readonly string[]` | | Initial values. | | `onValueChange?` | `(value: string[], items: SelectItem[]) => void` | | When the selection changes. | | `items?` | `SelectItemsSource` | | Suggestions: an array, a Promise or a function called once. | | `loadItems?` | `SelectLoader` | | Function that searches and paginates on the server. | | `allowCustomValue?` | `boolean` | `false` | Text not in the list also becomes a value (tags, email recipients). | | `openOnFocus?` | `boolean` | `false` | Should the list open on focus (without typing)? | | `inputValue?` | `string` | | Text in the box, for controlled use. | | `onInputChange?` | `(text: string) => void` | | When the text in the box changes. | | `placeholder?` | `string` | | Placeholder. | | `emptyMessage?` | `ReactNode` | | When there are no suggestions. | | `icon?` | `IconProp` | | Icon at the start of the box. | | `clearable?` | `boolean` | `true` | Clear button. | | `open?` | `boolean` | | Whether the list is open, for controlled use. | | `onOpenChange?` | `(open: boolean) => void` | | When the list opens or closes. | | `variant?` | `FieldVariant` | `"outline"` | Field variant. | | `aria-label?` | `string` | | Screen reader name; give it if there is no visible `label`. | | `style?` | `StyleProp` | | Container style. | ### AutocompleteProps _type_ Props of `Autocomplete` (same names as web). ```ts type AutocompleteProps = SingleAutocompleteProps | MultiAutocompleteProps ``` Also accepts the properties of: `FieldProps` | Property | Type | Default | Description | | --- | --- | --- | --- | | `multiple?` | `false \| true` | | Single selection. | | `value?` | `string \| readonly string[]` | | Selected value (controlled). | | `defaultValue?` | `string \| readonly string[]` | | Initial value. | | `onValueChange?` | `(value: string, item: SelectItem \| undefined) => void \| (value: string[], items: SelectItem[]) => void` | | When the selection changes. | | `items?` | `SelectItemsSource` | | Suggestions: an array, a Promise or a function called once. | | `loadItems?` | `SelectLoader` | | Function that searches and paginates on the server. | | `allowCustomValue?` | `boolean` | `false` | Text not in the list also becomes a value (tags, email recipients). | | `openOnFocus?` | `boolean` | `false` | Should the list open on focus (without typing)? | | `inputValue?` | `string` | | Text in the box, for controlled use. | | `onInputChange?` | `(text: string) => void` | | When the text in the box changes. | | `placeholder?` | `string` | | Placeholder. | | `emptyMessage?` | `ReactNode` | | When there are no suggestions. | | `icon?` | `IconProp` | | Icon at the start of the box. | | `clearable?` | `boolean` | `true` | Clear button. | | `open?` | `boolean` | | Whether the list is open, for controlled use. | | `onOpenChange?` | `(open: boolean) => void` | | When the list opens or closes. | | `variant?` | `FieldVariant` | `"outline"` | Field variant. | | `aria-label?` | `string` | | Screen reader name; give it if there is no visible `label`. | | `style?` | `StyleProp` | | Container style. | ## Avatar ### Avatar _component_ Profile photo. Shows the name's initials until the photo loads or if it fails; no layout shift, no broken image. ```tsx ``` ### AvatarGroup _component_ Overlapping row of avatars; those that do not fit are counted as "+N". `` ### AvatarSize _type_ Avatar size: 24, 32, 40, 48, 64 pixels (same as web). ```ts type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" ``` ### AvatarStatus _type_ Online status: the colored dot in the corner. ```ts type AvatarStatus = "online" | "away" | "busy" | "offline" ``` ### AvatarProps _type_ Props of `Avatar`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `src?` | `string \| ImageSourcePropType \| null` | | Photo: a URL or `require("./photo.png")`. If it fails to load, initials or an icon appear instead. | | `name?` | `string` | | The person's name: screen reader name and initials when there is no photo. | | `icon?` | `IconProp` | | Icon shown when there is neither a name nor a photo. | | `fallback?` | `ReactNode` | | Your own fallback content (instead of the initials). | | `size?` | `AvatarSize` | `"md"` | Size. See `AvatarSize`. | | `shape?` | `"circle" \| "square"` | `"circle"` | Shape. | | `status?` | `AvatarStatus` | | Status dot in the corner. See `AvatarStatus`. | | `effect?` | `EffectProp` | | Effect or effects (`"pulse"`, `"lift"`…). Defaults to `appearance.defaults.avatar.effect`. See `BuiltinEffect`. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold (e.g. the person's name). See `TooltipProp`. | | `style?` | `StyleProp` | | Container style. | ### AvatarGroupItem _type_ A person in `AvatarGroup`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `src?` | `string \| ImageSourcePropType \| null` | | Photo. | | `name` | `string` | | Name. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold (e.g. name and role). | ### AvatarGroupProps _type_ Props of `AvatarGroup`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `items` | `readonly AvatarGroupItem[]` | | People. | | `max?` | `number` | | Maximum avatars shown; the rest are counted as "+3". | | `size?` | `AvatarSize` | `"md"` | Size. | | `style?` | `StyleProp` | | Container style. | ## BackToTop ### BackToTop _component_ "Back to top" button (same behavior as web): appears in the corner once the list is scrolled `threshold` far, and scrolls smoothly to the top on press. For long lists, feeds and document screens. - **Progress:** the ring around it fills with the read part of the list (`progress={false}` turns it off). Only this button re-renders; the list and screen do not. - **On scroll up:** with `showOnScrollUp` it appears only while scrolling up. - **Accessibility:** hidden from screen readers while hidden; "Back to top" is announced after scrolling up. With reduced motion scrolling is instant. Place it as a sibling of the scroll component, in the view wrapping the screen. ```tsx const scroll = useScrollTracker(); ``` ### BackToTopPosition _type_ Button placement (same as web). ```ts type BackToTopPosition = "bottom-right" | "bottom-left" | "bottom-center" ``` ### BackToTopProps _type_ Props of the `BackToTop` component. | Property | Type | Default | Description | | --- | --- | --- | --- | | `scroll` | `ScrollTracker` | | The tracked list (`useScrollTracker`); position, progress and scrolling to top come from it. | | `threshold?` | `number` | `400` | Distance that must be scrolled for the button to appear (dp). | | `position?` | `BackToTopPosition` | `"bottom-right"` | Button placement. | | `progress?` | `boolean` | `true` | Show reading progress in the ring? | | `showOnScrollUp?` | `boolean` | `false` | Show only while scrolling up? Does not cover the content while reading down. | | `offset?` | `number` | `16` | Distance from the edges (dp); the safe area inset is added. | | `icon?` | `IconProp` | `up arrow` | Button icon. | | `label?` | `string` | `the `backToTop` text ("Başa dön")` | Screen reader name and tooltip. | | `children?` | `ReactNode` | | Text shown next to the icon; when given, the button becomes a pill. | | `tooltip?` | `TooltipProp \| false` | | Tooltip. Defaults to `label`; `false` turns it off. | | `onPress?` | `() => void` | | Called after scrolling to the top. | | `style?` | `ViewStyle` | | Button style (e.g. `{ bottom: 72 }` for a bottom tab bar). | ## Badge ### Badge _component_ Small badge showing a status, label or count (same colors and sizes as web's `Badge`). ```tsx Draft Paid 3 Online ``` ### BadgeVariant _type_ Badge style (same as web). ```ts type BadgeVariant = "solid" | "soft" | "outline" ``` ### BadgeProps _type_ Props of `Badge`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `children?` | `ReactNode` | | Text or number. | | `tone?` | `Tone` | `"neutral"` (or `appearance.defaults.badge.tone`)` | Color. | | `variant?` | `BadgeVariant \| (string & {})` | `"soft"` | Variant: one of the built-in variants or a name added via `appearance.variants.badge` (the style's `color` field is the text color). | | `effect?` | `EffectProp` | | Effect or effects (`"shine"`, `"pulse"`…). Defaults to `appearance.defaults.badge.effect`. See `BuiltinEffect`. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold. See `TooltipProp`. | | `icon?` | `IconProp` | | Icon at the start of the text. | | `dot?` | `boolean` | | Puts a colored status dot before the text (e.g. "Online"). | | `size?` | `"sm" \| "md"` | `"md"` (or `appearance.defaults.badge.size`)` | Size. | | `accessibilityLabel?` | `string` | | Screen reader label (if the content is not text). | | `style?` | `StyleProp` | | Container style. | ## Breadcrumb ### Breadcrumb _component_ Breadcrumb showing where the user is in the app (Home › Products › Phone). The same `items` array as web's `Breadcrumb`; the last item is the current page. - **Links:** if `href` is an in-app path `Navigator` goes to that screen, otherwise it is opened by the system; or pass `onPress`. - **Long paths:** with `maxItems` the middle pages are collected in a (…) menu (`Menu`; opens from the bottom on phones). Pages that do not fit wrap to the next line; very long names are truncated. - **Sibling pages:** when an item has `menu`, the arrow next to it switches to pages at the same level. - **Phone:** by default the first page, (…) and the last two pages show; with `mobile="back"` only "‹ Parent page". Touch targets are at least 44 dp. - **Accessibility:** the current page is read as "selected", separators are not read. Arrows flip in right-to-left languages. ```tsx ``` ### BreadcrumbItem _type_ A page in the `Breadcrumb` `items` array (same fields as web, plus `onPress`). | Property | Type | Default | Description | | --- | --- | --- | --- | | `label` | `ReactNode` | | Name of the page. | | `href?` | `string` | | Address of the page. In-app paths like `/products` go to `Navigator` (`openLink`); others are opened by the system. If neither `href` nor `onPress` is given, the item is plain text. | | `onPress?` | `() => void` | | Called on tap (instead of or together with `href`; called first). | | `icon?` | `IconProp` | | Icon at the start of the text: a name, path data or an element. | | `iconOnly?` | `boolean` | | Shows only the icon; the text is read to screen readers and shown as a tooltip on press and hold (e.g. a house icon for the home page). | | `current?` | `boolean` | | Is this the current page? If omitted, the last item is the current page. | | `menu?` | `readonly MenuEntry[]` | | Menu to switch to this page's siblings (e.g. switching projects). On a linked item a small arrow appears next to the text; on an unlinked item the text itself opens the menu. See `MenuEntry`. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold. On an `iconOnly` item `label` is shown if not given. See `TooltipProp`. | ### BreadcrumbMobile _type_ Behavior on narrow screens (below 640 dp, phones) (same as web). - `"collapse"`: The first page, a (…) menu revealing hidden pages, and the last two pages. - `"back"`: Only a "‹ Parent page" link going one level up. - `"full"`: Same as on wide screens; pages that do not fit wrap to the next line. ```ts type BreadcrumbMobile = "collapse" | "back" | "full" ``` ### BreadcrumbProps _type_ Props of the `Breadcrumb` component. | Property | Type | Default | Description | | --- | --- | --- | --- | | `items` | `readonly BreadcrumbItem[]` | | Pages from the root to the current page. | | `separator?` | `ReactNode` | `A right-pointing arrow (›)` | Separator between pages: text (`"/"`, `"·"`) or an element. | | `maxItems?` | `number` | | Maximum number of pages shown. The rest are collected in a (…) menu after the first page; the first page and the last `maxItems - 1` pages stay visible. | | `mobile?` | `BreadcrumbMobile` | `"collapse"` | Behavior on narrow screens. See `BreadcrumbMobile`. | | `label?` | `string` | `the `breadcrumb` text (`"Sayfa yolu"`)` | Screen reader name of the navigation region. | | `effect?` | `EffectProp` | | Effect of the links (e.g. `"scale"`, `"ripple"`). Defaults to `UIProvider` `appearance.defaults.breadcrumb.effect`. | | `style?` | `StyleProp` | | Container style. | | `testID?` | `string` | | Test ID. | ## Button ### Button _component_ Button. Same API as web's `Button`: `variant`, `tone`, `size`, `shape`, `icon`, `loading`, `effect`, `tooltip`, and an automatic loading state with an `onPress` that returns a Promise. Looks the same on Android and iOS (shadows and gradients via RN's platform-independent `boxShadow` and `backgroundImage` styles, effects drawn on the native driver). The touch target is at least 44×44 pixels. - For app-wide variant, color, size, shape and effect use `UIProvider` `appearance.defaults.button`; for your own variants `appearance.variants.button` (the style's `color` field is the text and icon color). - Inside a `ButtonGroup`, missing `variant`, `tone`, `size` and `disabled` come from the group. - For icon-only buttons use `IconButton`. ```tsx ``` ### IconButton _component_ Square icon-only button (web's `IconButton`). Its height matches text buttons via `size`; the variant defaults to `ghost` (the group's variant inside a `ButtonGroup`). Its name shows as a tooltip on press and hold. ```tsx ``` ### ButtonGroup _component_ Brings related buttons together as a single piece (same API as web's `ButtonGroup`): toolbars, split buttons (Save + ▾), view switchers, alignment and formatting buttons. - **Two ways to use:** put your own `Button`/`IconButton`/`Menu` elements in `children`, or pass an `items` array and let the group render the buttons. Selection mode, split buttons and the "More" menu work with `items`. - **Attached** (default): inner corners are removed, borders overlap, and solid buttons get a thin line between them. - **Selection mode:** `selection="single"` is single-select, `"multiple"` multi-select; pressed buttons carry `aria-pressed` and look highlighted. - **Phone:** with `overflow="menu"` buttons that do not fit move into a trailing ⋯ menu; recalculated when the width changes (rotation, split screen); measurements are cached so it does not flicker. ```tsx ``` ### ButtonVariant _type_ Button variant (same names and look as web's `ButtonVariant`). - `solid`: filled; the primary action on the screen. - `soft`: tinted background; a secondary but colored action. - `outline`: bordered. - `ghost`: no background; toolbars and lists. - `link`: text like a link. - `gradient`: a filled button with a subtle gradient from the tone color. - `elevated`: shadowed, raised from the surface. - `dashed`: dashed border; placeholder actions like "add". ```ts type ButtonVariant = "solid" | "soft" | "outline" | "ghost" | "link" | "gradient" | "elevated" | "dashed" ``` ### ButtonShape _type_ Corner shape: `rounded` theme radius, `pill` fully round, `sharp` square corners. ```ts type ButtonShape = "rounded" | "pill" | "sharp" ``` ### ButtonProps _type_ Props of `Button`. Also accepts the properties of: `Omit` | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `children?` | `ReactNode` | | Button text or content. | | `variant?` | `ButtonVariant \| (string & {})` | `"solid"` | Variant: one of the built-in variants (`ButtonVariant`) or a name added via `UIProvider` `appearance.variants.button`. If omitted, the `ButtonGroup`'s variant is used, then `appearance.defaults.button`. | | `tone?` | `Tone` | `"primary"` | Color: the meaning of the action. | | `size?` | `Size` | `"md"` | Height: `sm` 32, `md` 40, `lg` 48 pixels. | | `shape?` | `ButtonShape` | `"rounded"` (or `appearance.defaults.button.shape`)` | Corner shape. | | `effect?` | `EffectProp` | | Effect or effects: on press `scale`, `ripple`, `pulse`, `bounce`; while pressed `lift`, `border`, `beam`, `glow`, `tilt`, `shine`; or a custom effect added via `appearance.effects`. Can be combined as an array (`["ripple", "glow"]`). Defaults to `appearance.defaults.button.effect`, otherwise `scale` (no effect for the `link` variant). `"none"` turns all off. See `BuiltinEffect`. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold: text, content or settings (`{ content, side, touch }`). Works while the button is disabled too; useful to explain why it cannot be pressed. See `TooltipProp`. | | `icon?` | `IconProp` | | Icon before the text. See `IconProp`. | | `iconEnd?` | `IconProp` | | Icon after the text. | | `loading?` | `boolean` | | Loading: a spinner instead of the icon, cannot be pressed. | | `block?` | `boolean` | | Fills its row. | | `onPress?` | `(event: GestureResponderEvent) => unknown` | | Called on press. If it returns a Promise the button shows loading automatically until it settles (same behavior as web's `onClick`). | | `accessibilityLabel?` | `string` | | Screen reader label; should be considered required only on icon-only buttons. | | `style?` | `StyleProp` | | Container style. | ### IconButtonProps _type_ Props of `IconButton`. Also accepts the properties of: `Omit, "children" | "iconEnd" | "block" | "accessibilityLabel">` | Property | Type | Default | Description | | --- | --- | --- | --- | | `icon` | `IconProp` | | Icon shown on the button: a name (`"trash"`) or an element. | | `label` | `string` | | Name of the button. Screen readers read it; shown as a tooltip on press and hold. Required, because an icon alone is not a name. | | `tooltip?` | `TooltipProp` | | Tooltip. Defaults to `label`; use it to give a different text or settings, turn it off with `false`. | | `ref?` | `Ref` | | Ref of the underlying native element. | | `variant?` | `ButtonVariant \| (string & {})` | `"solid"` | Variant: one of the built-in variants (`ButtonVariant`) or a name added via `UIProvider` `appearance.variants.button`. If omitted, the `ButtonGroup`'s variant is used, then `appearance.defaults.button`. | | `tone?` | `Tone` | `"primary"` | Color: the meaning of the action. | | `size?` | `Size` | `"md"` | Height: `sm` 32, `md` 40, `lg` 48 pixels. | | `shape?` | `ButtonShape` | `"rounded"` (or `appearance.defaults.button.shape`)` | Corner shape. | | `effect?` | `EffectProp` | | Effect or effects: on press `scale`, `ripple`, `pulse`, `bounce`; while pressed `lift`, `border`, `beam`, `glow`, `tilt`, `shine`; or a custom effect added via `appearance.effects`. Can be combined as an array (`["ripple", "glow"]`). Defaults to `appearance.defaults.button.effect`, otherwise `scale` (no effect for the `link` variant). `"none"` turns all off. See `BuiltinEffect`. | | `loading?` | `boolean` | | Loading: a spinner instead of the icon, cannot be pressed. | | `onPress?` | `(event: GestureResponderEvent) => unknown` | | Called on press. If it returns a Promise the button shows loading automatically until it settles (same behavior as web's `onClick`). | | `style?` | `StyleProp` | | Container style. | ### ButtonGroupItem _type_ A button in the `ButtonGroup` `items` array (same fields as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `value?` | `V` | | ID of the item. In selection mode (`selection`) this is the selected value; also used as the React key. Required in selection mode. | | `label` | `ReactNode` | | Button text. With `iconOnly` it must be given as text; it becomes the screen reader name and tooltip. | | `icon?` | `IconProp` | | Icon at the start of the text: a name or an element. | | `iconEnd?` | `IconProp` | | Icon at the end of the text. | | `iconOnly?` | `boolean` | | Shows only the icon (square button, `IconButton`); `label` becomes the name and tooltip. | | `tone?` | `Tone` | | This button's color; defaults to the group's color. | | `disabled?` | `boolean` | | Cannot be pressed. Locks this item regardless of the group's `disabled`. | | `loading?` | `boolean` | | Loading state. Happens automatically when `onPress` returns a Promise. | | `tooltip?` | `TooltipProp` | | Tooltip (on press and hold). See `TooltipProp`. | | `onPress?` | `(event: GestureResponderEvent \| undefined) => unknown` | | Called on press. If it returns a Promise the button shows loading automatically. In selection mode it is called after the selection changes. If the item moved into the "More" menu, it is also called when chosen from the menu. | | `menu?` | `readonly MenuEntry[]` | | When given, the button opens a menu (like the arrow part of a split button). | | `style?` | `StyleProp` | | Button style. | ### ButtonGroupOverflow _type_ What happens to buttons that do not fit in the group (same as web). - `"none"`: Nothing; buttons stay on one line. - `"wrap"`: They wrap to the next line. Only meaningful with `attached={false}`. - `"menu"`: Those that do not fit move into a trailing "More actions" (⋯) menu (opens as a bottom sheet on phones). The group takes the full width of its area. Works only with `items` and in a horizontal group. ```ts type ButtonGroupOverflow = "none" | "wrap" | "menu" ``` ### ButtonGroupProps _type_ Props of `ButtonGroup`: an action group, single-select or multi-select group. ```ts type ButtonGroupProps = ButtonGroupActionProps | ButtonGroupSingleProps | ButtonGroupMultipleProps ``` | Property | Type | Default | Description | | --- | --- | --- | --- | | `selection?` | `undefined \| "single" \| "multiple"` | | Selection mode off. | | `value?` | `undefined \| V \| null \| V[]` | | Selected value(s) (controlled); only with `selection`. | | `defaultValue?` | `undefined \| V \| null \| V[]` | | Initial selection; only with `selection`. | | `onValueChange?` | `undefined \| (value: V \| null) => void \| (value: V[]) => void` | | Called when the selection changes; only with `selection`. | | `required?` | `undefined \| boolean \| boolean` | | Keeps a button pressed; only with `selection`. | | `ref?` | `Ref` | | Ref of the container. | | `variant?` | `ButtonVariant \| (string & {})` | | Variant of the buttons inside (a button's own `variant` wins). | | `tone?` | `Tone` | | Color of the buttons inside. | | `size?` | `Size` | | Height of the buttons inside. | | `disabled?` | `boolean` | | Disables all buttons. | | `orientation?` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout direction. | | `attached?` | `boolean` | `true` | Are the buttons attached? With `true` the inner corners are removed and borders merge; with `false` there is a gap between buttons. | | `block?` | `boolean` | | Takes the full width of its area; buttons share the area equally. | | `label?` | `string` | | Screen reader name of the group (e.g. "Text alignment"). | | `overflow?` | `ButtonGroupOverflow` | `"none"` | What happens to buttons that do not fit. See `ButtonGroupOverflow`. | | `items?` | `readonly ButtonGroupItem[] \| readonly ButtonGroupItem[] \| readonly ButtonGroupItem[]` | | Buttons as an array. Selection mode, split buttons (`menu`) and `overflow="menu"` work this way. If omitted, `children` is rendered. | | `children?` | `ReactNode` | | Your own buttons: `Button`, `IconButton`, `Menu` with a button trigger. Missing `variant`, `tone`, `size`, `disabled` come from the group. | | `style?` | `StyleProp` | | Container style. | | `testID?` | `string` | | Test ID. | ## Calendar ### Calendar _component_ Month calendar: selects a single day, a range or multiple days. Month and day names and the first day of the week come from the `UIProvider` `locale`. Tapping the month name in the header opens the month, then the year view; swiping left/right changes the month. Days have 44-pixel touch targets. Calculations are the same as web (`@yasinsensoy/core/date`). ```tsx ``` ### DateInput _type_ Type of props that take a date: an ISO date string like `"2026-10-28"` or a `Date`. For a `Date`, the day in local time is used. ```ts type DateInput = string | Date ``` ### DateRange _type_ A date range. Values are ISO date strings in `"YYYY-MM-DD"` form; an unselected end is an empty string (`""`). | Property | Type | Default | Description | | --- | --- | --- | --- | | `start` | `string` | | Start day. | | `end` | `string` | | End day (the start is included). | ### CalendarBaseProps _type_ Props shared by all calendar types (same names as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `min?` | `DateInput` | | Earliest selectable day. | | `max?` | `DateInput` | | Latest selectable day. | | `isDateDisabled?` | `(date: Date) => boolean` | | Days that cannot be selected (e.g. weekends). | | `disabled?` | `boolean` | | The whole calendar is disabled. | | `readOnly?` | `boolean` | | Display only. | | `month?` | `DateInput` | | Displayed month (controlled). | | `defaultMonth?` | `DateInput` | `the selected day or today` | Initially displayed month. | | `onMonthChange?` | `(month: string) => void` | | ISO day (`"2026-10-01"`) when the displayed month changes. | | `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `from the locale` | First day of the week (0 Sunday … 6 Saturday). | | `showOutsideDays?` | `boolean` | `true` | Show days of the previous and next month faded. | | `fixedWeeks?` | `boolean` | `false` | 6 weeks every month: the height stays fixed. | | `marks?` | `readonly DateInput[] \| ((date: Date) => boolean)` | | Days with a dot below (e.g. an event). | | `aria-label?` | `string` | `the {@link UIProvider} `calendar` text` | Screen reader name. | | `style?` | `StyleProp` | | Container style. | ### DateRangeInput _type_ Type of props that take a range; ends may be strings or `Date`s. | Property | Type | Default | Description | | --- | --- | --- | --- | | `start?` | `DateInput \| null` | | Start day. | | `end?` | `DateInput \| null` | | End day. | ### SingleCalendarProps _type_ Calendar selecting a single day. | Property | Type | Default | Description | | --- | --- | --- | --- | | `mode?` | `"single"` | | Single day. | | `value?` | `DateInput` | | Selected day (controlled); `""` for none. | | `defaultValue?` | `DateInput` | | Initially selected day. | | `onValueChange?` | `(value: string, date: Date \| undefined) => void` | | ISO day and `Date` when the selection changes. | | `min?` | `DateInput` | | Earliest selectable day. | | `max?` | `DateInput` | | Latest selectable day. | | `isDateDisabled?` | `(date: Date) => boolean` | | Days that cannot be selected (e.g. weekends). | | `disabled?` | `boolean` | | The whole calendar is disabled. | | `readOnly?` | `boolean` | | Display only. | | `month?` | `DateInput` | | Displayed month (controlled). | | `defaultMonth?` | `DateInput` | `the selected day or today` | Initially displayed month. | | `onMonthChange?` | `(month: string) => void` | | ISO day (`"2026-10-01"`) when the displayed month changes. | | `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `from the locale` | First day of the week (0 Sunday … 6 Saturday). | | `showOutsideDays?` | `boolean` | `true` | Show days of the previous and next month faded. | | `fixedWeeks?` | `boolean` | `false` | 6 weeks every month: the height stays fixed. | | `marks?` | `readonly DateInput[] \| ((date: Date) => boolean)` | | Days with a dot below (e.g. an event). | | `aria-label?` | `string` | `the {@link UIProvider} `calendar` text` | Screen reader name. | | `style?` | `StyleProp` | | Container style. | ### RangeCalendarProps _type_ Calendar selecting a date range. | Property | Type | Default | Description | | --- | --- | --- | --- | | `mode` | `"range"` | | The first tap picks the start, the second the end. | | `value?` | `DateRangeInput` | | Selected range (controlled). | | `defaultValue?` | `DateRangeInput` | | Initial range. | | `onValueChange?` | `(range: DateRange) => void` | | When the selection changes; `end` is empty until the end is picked. | | `minDays?` | `number` | | Minimum number of days in the range (both ends included). | | `maxDays?` | `number` | | Maximum number of days in the range. | | `min?` | `DateInput` | | Earliest selectable day. | | `max?` | `DateInput` | | Latest selectable day. | | `isDateDisabled?` | `(date: Date) => boolean` | | Days that cannot be selected (e.g. weekends). | | `disabled?` | `boolean` | | The whole calendar is disabled. | | `readOnly?` | `boolean` | | Display only. | | `month?` | `DateInput` | | Displayed month (controlled). | | `defaultMonth?` | `DateInput` | `the selected day or today` | Initially displayed month. | | `onMonthChange?` | `(month: string) => void` | | ISO day (`"2026-10-01"`) when the displayed month changes. | | `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `from the locale` | First day of the week (0 Sunday … 6 Saturday). | | `showOutsideDays?` | `boolean` | `true` | Show days of the previous and next month faded. | | `fixedWeeks?` | `boolean` | `false` | 6 weeks every month: the height stays fixed. | | `marks?` | `readonly DateInput[] \| ((date: Date) => boolean)` | | Days with a dot below (e.g. an event). | | `aria-label?` | `string` | `the {@link UIProvider} `calendar` text` | Screen reader name. | | `style?` | `StyleProp` | | Container style. | ### MultipleCalendarProps _type_ Calendar selecting multiple days. | Property | Type | Default | Description | | --- | --- | --- | --- | | `mode` | `"multiple"` | | Each tap selects or deselects a day. | | `value?` | `readonly DateInput[]` | | Selected days (controlled). | | `defaultValue?` | `readonly DateInput[]` | | Initially selected days. | | `onValueChange?` | `(values: string[], dates: Date[]) => void` | | Sorted ISO days and `Date`s when the selection changes. | | `min?` | `DateInput` | | Earliest selectable day. | | `max?` | `DateInput` | | Latest selectable day. | | `isDateDisabled?` | `(date: Date) => boolean` | | Days that cannot be selected (e.g. weekends). | | `disabled?` | `boolean` | | The whole calendar is disabled. | | `readOnly?` | `boolean` | | Display only. | | `month?` | `DateInput` | | Displayed month (controlled). | | `defaultMonth?` | `DateInput` | `the selected day or today` | Initially displayed month. | | `onMonthChange?` | `(month: string) => void` | | ISO day (`"2026-10-01"`) when the displayed month changes. | | `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `from the locale` | First day of the week (0 Sunday … 6 Saturday). | | `showOutsideDays?` | `boolean` | `true` | Show days of the previous and next month faded. | | `fixedWeeks?` | `boolean` | `false` | 6 weeks every month: the height stays fixed. | | `marks?` | `readonly DateInput[] \| ((date: Date) => boolean)` | | Days with a dot below (e.g. an event). | | `aria-label?` | `string` | `the {@link UIProvider} `calendar` text` | Screen reader name. | | `style?` | `StyleProp` | | Container style. | ### CalendarProps _type_ Props of `Calendar`. ```ts type CalendarProps = SingleCalendarProps | RangeCalendarProps | MultipleCalendarProps ``` | Property | Type | Default | Description | | --- | --- | --- | --- | | `mode?` | `"single" \| "range" \| "multiple"` | | Single day. | | `value?` | `DateInput \| DateRangeInput \| readonly DateInput[]` | | Selected day (controlled); `""` for none. | | `defaultValue?` | `DateInput \| DateRangeInput \| readonly DateInput[]` | | Initially selected day. | | `onValueChange?` | `(value: string, date: Date \| undefined) => void \| (range: DateRange) => void \| (values: string[], dates: Date[]) => void` | | ISO day and `Date` when the selection changes. | | `min?` | `DateInput` | | Earliest selectable day. | | `max?` | `DateInput` | | Latest selectable day. | | `isDateDisabled?` | `(date: Date) => boolean` | | Days that cannot be selected (e.g. weekends). | | `disabled?` | `boolean` | | The whole calendar is disabled. | | `readOnly?` | `boolean` | | Display only. | | `month?` | `DateInput` | | Displayed month (controlled). | | `defaultMonth?` | `DateInput` | `the selected day or today` | Initially displayed month. | | `onMonthChange?` | `(month: string) => void` | | ISO day (`"2026-10-01"`) when the displayed month changes. | | `weekStartsOn?` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | `from the locale` | First day of the week (0 Sunday … 6 Saturday). | | `showOutsideDays?` | `boolean` | `true` | Show days of the previous and next month faded. | | `fixedWeeks?` | `boolean` | `false` | 6 weeks every month: the height stays fixed. | | `marks?` | `readonly DateInput[] \| ((date: Date) => boolean)` | | Days with a dot below (e.g. an event). | | `aria-label?` | `string` | `the {@link UIProvider} `calendar` text` | Screen reader name. | | `style?` | `StyleProp` | | Container style. | | `minDays?` | `number` | | Minimum number of days in the range (both ends included). _(Only: RangeCalendarProps)_ | | `maxDays?` | `number` | | Maximum number of days in the range. _(Only: RangeCalendarProps)_ | ## CameraView ### CameraView _component_ Camera preview. Capturing is done via `ref`. Camera permission must be granted beforehand (`usePermission("camera")`); without it `onError` is called with `E_PERMISSION`, and the preview opens automatically once permission is granted. ### Camera _module_ About the device camera. | Property | Type | Default | Description | | --- | --- | --- | --- | | `isAvailable` | `() => boolean` | | Does the device have a camera. | | `devices` | `() => CameraFacing[]` | | Available facings (`["back", "front"]`). | ### CameraFacing _type_ Camera facing. ```ts type CameraFacing = "back" | "front" ``` ### CameraFlash _type_ Flash (when taking a photo). ```ts type CameraFlash = "off" | "on" | "auto" ``` ### CameraPhoto _type_ A captured photo. | Property | Type | Default | Description | | --- | --- | --- | --- | | `uri` | `string` | | Temporary file (`file://…`); move it to your own folder to keep it. | | `width` | `number` | | Width with rotation applied (pixels). | | `height` | `number` | | Height with rotation applied (pixels). | ### CameraVideo _type_ A recorded video. | Property | Type | Default | Description | | --- | --- | --- | --- | | `uri` | `string` | | Temporary file (`file://…`; Android `.mp4`, iOS `.mov`). | | `duration` | `number` | | Duration (seconds). | ### TakePhotoOptions _type_ Options for `CameraHandle.takePhoto`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `quality?` | `number` | `0.9` | JPEG quality (0–1). Applied on Android; iOS uses the system quality. | ### RecordOptions _type_ Options for `CameraHandle.startRecording`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `audio?` | `boolean` | `true` | Record audio. If microphone permission (`ui.config` `permissions.microphone`) is not granted, the video is recorded silent. | | `maxDuration?` | `number` | | Maximum duration (seconds); recording stops automatically when reached. | ### CameraError _type_ Camera error (`onError`). | Property | Type | Default | Description | | --- | --- | --- | --- | | `code` | `string` | | `E_PERMISSION`, `E_NO_CAMERA`, `E_CAMERA`… | | `message` | `string` | | Error message. | ### CameraHandle _type_ Handle of `CameraView` (`ref`). | Property | Type | Default | Description | | --- | --- | --- | --- | | `takePhoto` | `(options?: TakePhotoOptions): Promise` | | Takes a photo. | | `startRecording` | `(options?: RecordOptions): Promise` | | Starts video recording; the returned promise resolves when recording ends (`stopRecording` or duration). | | `stopRecording` | `(): Promise` | | Stops recording. | ### CameraViewProps _type_ Props of `CameraView`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `facing?` | `CameraFacing` | `"back"` | Front or back camera. | | `flash?` | `CameraFlash` | `"off"` | Photo flash. | | `torch?` | `boolean` | `false` | Torch (continuous light). | | `zoom?` | `number` | `0` | Zoom: 0 (none) – 1 (the maximum the device allows, up to 10x). | | `active?` | `boolean` | `true` | When `false`, the camera turns off (the view stays). | | `onReady?` | `() => void` | | Preview started; capturing is now possible. | | `onError?` | `(error: CameraError) => void` | | Error (no permission, camera could not open…). | | `onRecordingStart?` | `() => void` | | Video recording started. | | `style?` | `StyleProp` | | Style; give it a size (the preview fills the area, edges are cropped). | | `testID?` | `string` | | Test ID. | | `ref?` | `Ref` | | Handle. | ## Card ### Card _component_ Surface grouping content: title, description, content and footer. Same spacing (24 px padding, theme radius + 4), variants and effects as web's `Card`. The surface is drawn by `View`; defaults are given via `appearance.defaults.card`. ```tsx Save}> ``` ### CardVariant _type_ Card variant (same names and colors as web's `Card variant`). - `outline`: bordered surface (default). - `elevated`: with a pronounced shadow. - `filled`: borderless, muted background. - `ghost`: no background or border; layout only. - `dashed`: dashed border, no background. - `gradient`: a gradient from the accent color (`tone`) into the card. - `glass`: translucent glass surface (no blur; see `SurfaceVariant`). Names added via `appearance.variants.card` can also be given. ```ts type CardVariant = "outline" | "elevated" | "filled" | "ghost" | "dashed" | "gradient" | "glass" ``` ### CardProps _type_ Props of `Card`. Also accepts the properties of: `ViewProps` | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `title?` | `ReactNode` | | Title. | | `description?` | `ReactNode` | | Description below the title. | | `footer?` | `ReactNode` | | Footer (action buttons). | | `icon?` | `IconProp` | | Icon to the left of the title (in a square box with a muted background). | | `action?` | `ReactNode` | | Action on the right of the title row (e.g. a small button or menu). | | `variant?` | `CardVariant \| (string & {})` | `"outline"` | Variant. Defaults to `appearance.defaults.card.variant`, otherwise `"outline"`. | | `tone?` | `Tone` | `"primary"` | Accent color: the color of effects and the `gradient` variant. | | `effect?` | `EffectProp` | | Effect or effects (`"lift"`, `["tilt", "glow"]`, `"beam"`…). See `BuiltinEffect`. Defaults to `appearance.defaults.card.effect`; otherwise `"scale"` when `onPress` is given. | | `active?` | `boolean` | `false` | Keeps effects on permanently (selected plan, featured card). | | `onPress?` | `(event: GestureResponderEvent) => void` | | When given, the card becomes pressable (like a list item). | | `style?` | `StyleProp` | | Container style. | ## Carousel ### Carousel _component_ Swipeable slideshow: product images, promo cards, stories, logo strips. Snap points, loop and flick calculations are the same as web (`@yasinsensoy/core/carousel`). Motion runs on the native driver (`useNativeDriver`); in loop mode the strip never visibly rewinds. ```tsx {promos.map((p) => )} {logos} ``` ### ResponsiveValue _type_ A value that varies with width: a single value or `{ min_width: value }` (the carousel's own width). ```ts type ResponsiveValue = T | { readonly [minWidth: number]: T; } ``` ### CarouselEffect _type_ Transition look: side-by-side slide, cross-fade, scaling down away from the center, or your own function. The function receives the slide's distance from the aligned position (in slides, `-1` is the previous one) as an Animated value. ```ts type CarouselEffect = "slide" | "fade" | "scale" | ((distance: Animated.AnimatedInterpolation) => Animated.WithAnimatedValue) ``` ### CarouselIndicators _type_ Indicators: dots, story lines, a `3 / 8` counter, thumbnails or none. ```ts type CarouselIndicators = "dots" | "lines" | "count" | "thumbnails" | false ``` ### CarouselAutoplay _type_ Autoplay settings. | Property | Type | Default | Description | | --- | --- | --- | --- | | `delay?` | `number` | `5000` | Time spent on a slide (ms). | | `stopOnInteraction?` | `boolean` | `false` | Stops permanently when touched; with `false` the timer restarts. | ### CarouselHandle _type_ Methods of the `Carousel` ref (same as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `next` | `() => void` | | Goes to the next slide (or page). | | `prev` | `() => void` | | Goes to the previous slide. | | `goTo` | `(index: number, options?: { instant?: boolean; }) => void` | | Goes to a slide. | | `play` | `() => void` | | Starts autoplay. | | `pause` | `() => void` | | Pauses autoplay. | ### CarouselProps _type_ Props of `Carousel` (same names as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `children` | `ReactNode` | | Slides: each child is a slide. | | `label?` | `string` | `"Karusel"` | Screen reader name. | | `loop?` | `boolean` | `false` | Infinite loop: the first slide follows the last one seamlessly. | | `slidesPerView?` | `ResponsiveValue` | `1` | Number of visible slides; may be fractional (`1.2`). | | `gap?` | `ResponsiveValue` | `16` | Gap between slides (px). | | `align?` | `CarouselAlign` | `"start"` | Alignment of the slide in the visible area. | | `step?` | `number \| "page"` | `1` | How many slides to advance per move; `"page"` advances by the visible count. | | `orientation?` | `"horizontal" \| "vertical"` | `"horizontal"` | Direction. Vertical requires `height`. | | `height?` | `number` | | Height (required when vertical). | | `index?` | `number` | | Selected slide (controlled). | | `defaultIndex?` | `number` | `0` | Initial slide. | | `onIndexChange?` | `(index: number) => void` | | When the selected slide changes (also while dragging). | | `onSettle?` | `(index: number) => void` | | When the motion ends and the slide settles into place. | | `autoplay?` | `boolean \| number \| CarouselAutoplay` | | Autoplay: `true`, the delay (ms) or settings. Stops while dragging. | | `marquee?` | `boolean \| number` | | Continuous flow (logo strip): scrolls at this speed (px/s); negative reverses. `true` = 40. | | `effect?` | `CarouselEffect` | `"slide"` | Transition look. | | `arrows?` | `boolean \| "always"` | `true` | Previous/next arrows. On touch screens visible only with `"always"`. | | `indicators?` | `CarouselIndicators` | `"dots"` | Indicators. | | `indicatorsPlacement?` | `"inside" \| "outside"` | `"outside"` | Whether indicators are over or below the slide. | | `thumbnails?` | `readonly (string \| ReactNode)[]` | | Thumbnails (`indicators="thumbnails"`): a URL or an element. | | `draggable?` | `boolean` | `true` | Draggable by touch. | | `snap?` | `boolean` | `true` | Snaps to slides; with `false` scrolls freely. | | `skipSnaps?` | `boolean` | `false` | A quick flick may skip several slides. | | `rewind?` | `boolean` | `false` | Without loop, the arrow at an end goes to the other end. | | `duration?` | `number` | `500` | Duration of the snap animation (ms). | | `ref?` | `Ref` | | External control. | | `style?` | `StyleProp` | | Container style. | ## Cascader ### Cascader _component_ Cascading picker (same API as web's `Cascader`): leveled choices such as province → district → neighborhood or category → subcategory. On phones a single column in a bottom sheet, proceeding level by level and going back with the button at the top; on tablets columns open side by side. - **Value:** a path array (`["istanbul", "kadikoy"]`); the box shows "İstanbul / Kadıköy". With `changeOnSelect` intermediate levels are selectable too. - **Loading:** `hasChildren` options are fetched via `loadChildren` when opened; a spinner in the row, "Try again" on error. - **Search:** with `search`, across all loaded paths, insensitive to Turkish letters. - **Form:** bound inside `Form` via `name`. ```tsx fetchDistricts(province.value, signal)} /> ``` ### CascaderOption _type_ An option in `Cascader` (same as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | | Unique value at this level; the path is made of these values. | | `label?` | `string` | | Display name. Defaults to `value`. | | `icon?` | `IconProp` | | Icon at the start of the name. | | `description?` | `ReactNode` | | Small description below the name. | | `children?` | `readonly CascaderOption[]` | | Child options. | | `hasChildren?` | `boolean` | | Child options are not loaded yet but exist; requested via `loadChildren` when opened. | | `disabled?` | `boolean` | | Cannot be selected. | ### CascaderProps _type_ Props of `Cascader` (same names as web). Also accepts the properties of: `FieldProps` | Property | Type | Default | Description | | --- | --- | --- | --- | | `options` | `readonly CascaderOption[]` | | Option tree (e.g. province → district → neighborhood). | | `value?` | `readonly string[]` | | Selected path in controlled use (`["istanbul", "kadikoy"]`); `[]` for none. | | `defaultValue?` | `readonly string[]` | | Initial path in uncontrolled use. | | `onValueChange?` | `(path: string[], options: CascaderOption[]) => void` | | When the selection changes, with the path and the options on it (`[]` when cleared). | | `loadChildren?` | `(option: CascaderOption, path: readonly CascaderOption[], signal: AbortSignal) => Promise` | | Fetches child options when a `hasChildren` option is opened. The result is kept; on error "Try again" appears. | | `changeOnSelect?` | `boolean` | `false` | Can intermediate levels be selected too? | | `search?` | `boolean` | `false` | Search box: searches all loaded paths ("kadı" → "İstanbul / Kadıköy"). | | `separator?` | `string` | `" / "` | Separator of the path in the box. | | `renderValue?` | `(options: CascaderOption[]) => ReactNode` | | How the path appears in the box. | | `placeholder?` | `string` | `"Seçiniz"` | Text shown when nothing is selected. | | `icon?` | `IconProp` | | Icon at the start of the box. | | `clearable?` | `boolean` | `false` | Clear button. | | `variant?` | `FieldVariant` | `"outline"` | Field variant. | | `open?` | `boolean` | | Whether the panel is open, for controlled use. | | `onOpenChange?` | `(open: boolean) => void` | | When the panel opens or closes. | | `aria-label?` | `string` | | Screen reader name; give it if there is no visible `label`. | | `style?` | `StyleProp` | | Container style. | ## Chart ### Chart _component_ Chart: bar, line, area, pie, donut and scatter. Calculations are the same as web's `Chart` (`@yasinsensoy/core/chart`): axis range, nice ticks, abbreviated numbers, date axis, downsampling. Drawing uses our own native view; no external library, identical on iOS and Android. - **Touch:** dragging a finger sideways makes the tooltip follow the values; vertical dragging scrolls the page. Tapping an empty area closes the tooltip. - **Legend:** appears with multiple series; tapping hides a series. Colors are bound to series, so hiding one does not change the others. - Colors come from the theme's `chart` palette and change automatically in dark theme. ```tsx ``` ### Sparkline _component_ Small chart showing a trend next to text or a number (no axes). Its width fits the container; drawing uses the same paths as web's `Sparkline`. ```tsx ``` ### ChartCurve _type_ Shape of the line between points. ```ts type ChartCurve = "smooth" | "linear" | "step" ``` ### ChartType _type_ Chart type. See `ChartProps.type`. ```ts type ChartType = "bar" | "line" | "area" | "pie" | "donut" | "scatter" ``` ### ChartSeries _type_ Detailed definition of a `Chart` series (same as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `key` | `Key \| (string & {})` | | Field the value is read from. It is the series' ID; must be unique. | | `label?` | `string` | `key` | Name in the legend and tooltip. | | `color?` | `ChartColor` | `its position in the palette` | Color. | | `type?` | `ChartSeriesType` | `the chart's `type` | Drawing type of this series (bars + line together). | | `value?` | `(row: T) => number \| null \| undefined` | | Reads the value from a function. | | `format?` | `ChartFormat` | `the chart's `format` | Value format of this series. | | `curve?` | `ChartCurve` | `the chart's `curve` | Line curve. | | `dashed?` | `boolean` | | Dashed line. | | `dots?` | `boolean` | `true` with few points` | Show points on the line. | | `hidden?` | `boolean` | | The series starts hidden; can be shown from the legend. | ### ChartFormat _type_ Format of chart values (y axis, tooltip, labels). - `"number"`: Locale-grouped number (`12,480`). On the axis, values above 10,000 are abbreviated (`12.5K`). - `"compact"`: Abbreviated everywhere (`1.2M`). - `"percent"`: A ratio as a percentage (`0.25` → `25%`). - `"currency"`: Money (`$1,250.00`); the unit comes from the `UIProvider` `currency` setting or the chart's `currency` prop. - `Intl.NumberFormatOptions`: Full control (e.g. `{ style: "unit", unit: "kilogram" }`). - Function: Your own format (e.g. `(v) => `${v} pcs``). ```ts type ChartFormat = "number" | "compact" | "percent" | "currency" | Intl.NumberFormatOptions | ((value: number) => string) ``` ### ChartSeriesType _type_ How a series is drawn. In bar and line charts it may differ per series. ```ts type ChartSeriesType = "bar" | "line" | "area" ``` ### ChartColor _type_ Color: a tone (`"success"`), a palette index (`"chart-3"`) or any CSS color (`"#7c3aed"`, `"var(--brand)"`). When omitted, series take `--ui-chart-1` … `--ui-chart-8` in order. ```ts type ChartColor = Tone | `chart-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}` | (string & {}) ``` ### ChartXFormat _type_ Format of chart x values (axis and tooltip title). - `"date"`: Day (`Oct 29, 2026`), `"datetime"`: day and time, `"time"`: time, `"month"`: month and year, `"year"`: year. - `Intl.DateTimeFormatOptions`: Full control. - Function: Your own format; receives the raw x value. When omitted, dates are formatted automatically by time range and other values are written as is. ```ts type ChartXFormat = "date" | "datetime" | "time" | "month" | "year" | Intl.DateTimeFormatOptions | ((value: unknown) => string) ``` ### ChartReference _type_ A horizontal or vertical reference line (target, average, limit). | Property | Type | Default | Description | | --- | --- | --- | --- | | `value` | `number` | | Value of the line (on the y axis; on the value axis for horizontal bars). | | `label?` | `string` | | Short text next to the line (e.g. "Target"). | | `tone?` | `Tone` | `"neutral"` | Color. | ### ChartPoint _type_ A data point; passed in the press event. | Property | Type | Default | Description | | --- | --- | --- | --- | | `row` | `T` | | The row itself. | | `index` | `number` | | Index of the row in `data`. | | `series` | `string` | | `key` of the series. | | `value` | `number \| null` | | Value (`null` = empty). | ### ChartTooltipItem _type_ A row in the tooltip. | Property | Type | Default | Description | | --- | --- | --- | --- | | `key` | `string` | | `key` of the series. | | `label` | `string` | | Name of the series. | | `color` | `string` | | Color of the series. | | `value` | `number \| null` | | Value (`null` = empty). | | `formatted` | `string` | | Formatted value. | | `share?` | `number` | | Share in a percent stack or pie (0–1). | ### ChartTooltipInfo _type_ Info passed to `ChartProps.renderTooltip`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | | Title: the formatted x value; the slice name in a pie. | | `row` | `T \| undefined` | | The row (`undefined` for the "Other" slice). | | `index` | `number` | | Index of the row (`-1` for the "Other" slice). | | `items` | `ChartTooltipItem[]` | | Values of the series. | ### ChartProps _type_ Props of `Chart`. Names match web's `Chart`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `data` | `readonly T[]` | | Rows. For large data keep the array stable with `useMemo`. | | `type?` | `ChartType` | `"bar"` | Chart type: `bar`, `line`, `area`, `pie`, `donut`, `scatter`. | | `x` | `Key \| ((row: T) => unknown)` | | Field of the x value (category, date or number). The slice name in a pie. | | `series` | `Key \| readonly (Key \| ChartSeries)[]` | | Values to draw: a field, fields or detailed definitions. | | `label?` | `string` | | Screen reader name (e.g. "Monthly revenue"). | | `height?` | `number` | `260`, `240` for pies` | Height of the plot area. Width fits the container. | | `stacked?` | `boolean \| "percent"` | | Stacks bar and area series; `"percent"` is a 100% stack. | | `horizontal?` | `boolean` | | Horizontal bars. | | `curve?` | `ChartCurve` | `"smooth"` | Line curve. | | `dots?` | `boolean` | `true` with few points` | Points on lines. | | `legend?` | `boolean \| "top" \| "bottom"` | `"bottom"` with multiple series and for pies` | Legend; tapping hides/shows a series. | | `tooltip?` | `boolean` | `true` | Tooltip showing values on tap and while dragging a finger. | | `renderTooltip?` | `(info: ChartTooltipInfo) => ReactNode` | | Render the tooltip content yourself. | | `grid?` | `boolean` | `true` | Grid lines. | | `xAxis?` | `boolean` | `true` | x-axis labels. | | `yAxis?` | `boolean` | `true` | Value axis labels. | | `format?` | `ChartFormat` | `"number"` | Value format. | | `xFormat?` | `ChartXFormat` | | Format of x values. | | `yMin?` | `number` | | Lower bound of the value axis. | | `yMax?` | `number` | | Upper bound of the value axis. | | `labels?` | `boolean` | | Value labels (only those that fit). | | `references?` | `readonly ChartReference[]` | | Reference lines (target, average). | | `colors?` | `readonly ChartColor[]` | | Colors to use in order. | | `barSize?` | `number` | `32` | Maximum bar thickness. | | `center?` | `ReactNode \| false` | | Center of the donut; defaults to the total, or the tapped slice. `false` leaves it empty. | | `maxSlices?` | `number` | `8` | Maximum slices in a pie; the rest are grouped into "Other". | | `loading?` | `boolean` | | Data loading: faded if there is data, a skeleton otherwise. | | `empty?` | `ReactNode` | `the {@link UIProvider} `chartEmpty` text` | Content shown when there is no data. | | `animate?` | `boolean` | `true` | Fade in on mount. Off while "reduce motion" is on. | | `onPointClick?` | `(point: ChartPoint) => void` | | When a value is tapped. | | `zoom?` | `boolean \| ChartZoomOptions` | | Zoom (except pies): pinch with two fingers, pan with one finger while zoomed, double-tap to reset; +/−/reset buttons in the corner. | | `range?` | `ChartRange \| null` | | Visible range (controlled). `null` is all data. Pass it together with `onRangeChange`. See `ChartRange`. | | `defaultRange?` | `ChartRange` | | Initial visible range (uncontrolled). | | `onRangeChange?` | `(range: ChartRange \| null) => void` | | When the visible range changes; `null` when back to all. May be called on every move while zooming; defer expensive work. | | `locale?` | `string` | `{@link UIProvider} `locale` | Locale. | | `currency?` | `string` | `{@link UIProvider} `currency` | Currency. | | `style?` | `StyleProp` | | Container style. | ### ChartRangeValue _type_ Value of the `ChartRange` ends: an x value (category name, number or date). ```ts type ChartRangeValue = string | number | Date ``` ### ChartRange _type_ Visible range: two end x values (same as web). ```ts type ChartRange = readonly [ChartRangeValue, ChartRangeValue] ``` ### ChartZoomOptions _type_ Settings of `ChartProps.zoom`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `toolbar?` | `boolean` | `true` | Zoom out / zoom in / reset buttons at the top right. | ### SparklineProps _type_ Props of `Sparkline`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `data` | `readonly (number \| null \| undefined)[]` | | Values; `null` is a gap. | | `type?` | `"line" \| "area" \| "bar"` | `"line"` | Drawing type. | | `color?` | `ChartColor` | `"chart-1"` | Color: a semantic color, `"chart-3"` or any color. | | `height?` | `number` | `32` | Height (px). Width fits the container. | | `endDot?` | `boolean` | `true` | Highlight the last value with a dot (line and area). | | `label?` | `string` | | Screen reader text (e.g. "Last 12 months: rising"). Hidden if not given. | | `style?` | `StyleProp` | | Container style (for width). | ## Chat ### TypingIndicator _component_ Three bouncing dots (same as web). `Chat` shows it itself; it can also be used on its own in a header or contact list. `` ### Chat _component_ Chat screen: messaging like WhatsApp or an AI chat like ChatGPT, with the same message data and prop names as web. Grouping, day headers, text formatting and stream reading live in the shared core (`@yasinsensoy/core/chat`). - **List:** an inverted `FlatList`; the newest message at the bottom, `onLoadMore` when scrolling up. While scrolled up, a "jump to latest" button and the new message count. - **Message:** press and hold for a menu (react, reply, copy, edit, delete…), swipe right to reply, reaction chips, read ticks, attachments. - **AI:** thinking time, tool calls, sources, error and retry; copy / regenerate / rate below the response. - **Keyboard:** on iOS the composer moves above the keyboard. ```tsx const chat = useChat({ send: ({ messages, signal }) => fetch(API, { method: "POST", body: JSON.stringify({ messages }), signal }) }); react(m.id, toggleReaction(m.reactions, e, me))} /> ``` ### ChatComposer _component_ The chat's composer: for messaging and AI prompts. Grows as you type (up to 6 lines), attachments show with small previews, reply and edit bars appear on top; while streaming the send button becomes "Stop". `Chat` renders it itself; it can also be used on its own. ```tsx ask(text)} /> ``` ### parseStreamData _function_ Turns an SSE `data:` line into a part. Recognizes your own part objects (`type` field), OpenAI (`choices[0].delta.content`), Anthropic (`delta.text`, `delta.thinking`) and `{ text | content | delta }`; when it is not JSON it is the text itself. `[DONE]` and unknown ones are `null`. ```ts parseStreamData(data: string): ChatStreamPart | null ``` ### toggleReaction _function_ Toggles a reaction and returns the new list (does not mutate the array). With `single` (default, like WhatsApp) the person's previous reaction is removed. ```ts toggleReaction(reactions: readonly ChatReaction[] | undefined, emoji: string, userId: string, options?: { single?: boolean; }): ChatReaction[] ``` ```ts onReact={(message, emoji) => update(message.id, { reactions: toggleReaction(message.reactions, emoji, myId) }) } ``` ### readChatStream _function_ Turns a stream into parts: `Response` (`fetch`), `ReadableStream`, `AsyncIterable` or a single text. In SSE responses `data:` lines are decoded with `parse` (default `parseStreamData`). ```ts readChatStream(source: ChatStreamSource, options?: { parse?: (data: string) => ChatStreamPart | null; signal?: { readonly aborted: boolean; }; }): AsyncGenerator ``` ```ts for await (const part of readChatStream(await fetch("/api/chat"))) { ... } ``` ### applyStreamPart _function_ Applies a part to a message and returns the new message. ```ts applyStreamPart(message: M, part: ChatStreamPart): M ``` ### defaultChatMessages _constant_ Turkish chat texts. ```ts defaultChatMessages: ChatMessages ``` ### enChatMessages _constant_ English chat texts (the web `en` dictionary and React Native use the same text). ```ts enChatMessages: ChatMessages ``` ### useChat _function_ Manages the state of an AI chat (same API as web's `useChat`): keeps the messages, reads the response as a stream, stops, regenerates and edits. Chunks render once per frame; thinking time is measured. ```ts useChat(options: UseChatOptions): UseChatResult ``` ```tsx const chat = useChat({ send: ({ messages, signal }) => fetch(API, { method: "POST", body: JSON.stringify({ messages }), signal }), }); return ; ``` ### ChatMode _type_ Chat type: messaging like WhatsApp or an AI chat like ChatGPT. ```ts type ChatMode = "messaging" | "assistant" ``` ### ChatSuggestion _type_ Suggestion chip: text, or a separate label + prompt. ```ts type ChatSuggestion = string | { label: ReactNode; prompt: string; } ``` ### ChatProps _type_ Props of `Chat` (same names as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `messages` | `readonly ChatMessage[]` | | Messages, oldest to newest. | | `mode?` | `ChatMode` | `"messaging"` | Type. | | `currentUserId?` | `string` | | Your own user ID: whether a message is drawn on the right or the left. | | `users?` | `readonly ChatUser[]` | | People (name, avatar). | | `group?` | `boolean` | `true` if there are more than 2 people` | Group chat: names and avatars are shown. | | `status?` | `ChatStatus` | | AI status. | | `onSend?` | `(draft: ChatDraft) => unknown` | | When a message is sent. | | `onStop?` | `() => void` | | When "Stop" is pressed. | | `onReact?` | `(message: ChatMessage, emoji: string) => void` | | When a reaction is given (toggle with `toggleReaction`). | | `onEdit?` | `(message: ChatMessage, text: string) => unknown` | | When a message is edited. | | `onDelete?` | `(message: ChatMessage) => unknown` | | When a message is deleted. | | `onForward?` | `(message: ChatMessage) => void` | | Forward. | | `onStar?` | `(message: ChatMessage) => void` | | Star. | | `onPin?` | `(message: ChatMessage) => void` | | Pin. | | `onRetry?` | `(message: ChatMessage) => void` | | When a failed message or an errored response is tapped. | | `onRegenerate?` | `(message: ChatMessage) => void` | | Regenerate the response. | | `onFeedback?` | `(message: ChatMessage, value: "up" \| "down" \| null) => void` | | 👍/👎. | | `onCopy?` | `(message: ChatMessage) => void` | | Copy: the app writes to the clipboard (no extra dependency). The action is hidden if not given. | | `actions?` | `readonly ChatActionName[]` | | Only these actions are shown. | | `customActions?` | `readonly ChatCustomAction[]` | | Custom actions added to the menu. | | `canEdit?` | `(message: ChatMessage) => boolean` | `own messages that are not deleted` | Can a message be edited? | | `canDelete?` | `(message: ChatMessage) => boolean` | `own messages that are not deleted` | Can a message be deleted? | | `confirmDelete?` | `boolean` | `true` | Ask before deleting. | | `quickReactions?` | `readonly string[]` | | Quick reactions in the menu. | | `typing?` | `readonly string[]` | | IDs of the people typing ("Jane is typing…"). | | `hasMore?` | `boolean` | `false` | Are there older messages? | | `onLoadMore?` | `() => unknown` | | Fetches older messages when scrolling up; the indicator spins until the Promise settles. | | `unreadFrom?` | `string` | | "Unread" divider starting from this message. | | `suggestions?` | `readonly ChatSuggestion[]` | | Suggestion chips in an empty chat. | | `empty?` | `ReactNode` | | Content shown when empty. | | `header?` | `ReactNode` | | Header at the top (e.g. person name, avatar). | | `composer?` | `Partial> \| false` | | Composer settings; `false` hides it. | | `groupWindow?` | `number` | `5 minutes` | Messages from the same person within this time (ms) form one block. | | `collapseAfter?` | `number` | `700` | Messages longer than this many characters are shortened with "Read more". | | `swipeToReply?` | `boolean` | `true` | Swipe a message right to reply. | | `timeZone?` | `string` | | Time zone. | | `texts?` | `Partial` | | Texts of this chat. | | `onOpenAttachment?` | `(attachment: ChatAttachment, message: ChatMessage) => void` | | When an attachment (image, file) is tapped; fullscreen or opening is up to the app. | | `style?` | `StyleProp` | | Container style. | ### TypingIndicatorProps _type_ Three bouncing dots: the "typing…" and "thinking" state. | Property | Type | Default | Description | | --- | --- | --- | --- | | `label?` | `string` | | Text read by screen readers (e.g. "Jane is typing…"). | | `color?` | `string` | `the muted text color` | Dot color. | | `style?` | `StyleProp` | | Container style. | ### ChatComposerVariant _type_ Composer look: messaging or an AI prompt. ```ts type ChatComposerVariant = "messaging" | "assistant" ``` ### ChatComposerHandle _type_ Methods of the `ChatComposer` ref. | Property | Type | Default | Description | | --- | --- | --- | --- | | `focus` | `() => void` | | Focuses the input. | | `addFiles` | `(files: Iterable) => void` | | Adds files (at most `maxFiles`). | | `insertText` | `(text: string) => void` | | Appends to the end of the text. | | `clear` | `() => void` | | Clears the text and attachments. | ### ChatComposerProps _type_ Props of `ChatComposer` (same names as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `onSend` | `(draft: ChatDraft) => unknown` | | With the draft when sent. | | `value?` | `string` | | Text (controlled). | | `defaultValue?` | `string` | | Initial text. | | `onValueChange?` | `(value: string) => void` | | When the text changes. | | `variant?` | `ChatComposerVariant` | `"messaging"` | Look. | | `placeholder?` | `string` | | Placeholder. | | `disabled?` | `boolean` | | Disabled. | | `status?` | `ChatStatus` | `"ready"` | AI status; while streaming the send button becomes "Stop". | | `onStop?` | `() => void` | | When "Stop" is pressed. | | `onPickFiles?` | `() => Promise \| readonly ChatFile[]` | | Paperclip button: called on tap; return the chosen files (your own image/document picker). The component uses no extra dependency. | | `maxFiles?` | `number` | `10` | Maximum files in one message. | | `replyTo?` | `ChatMessage \| null` | | The message being replied to. | | `replyAuthor?` | `ReactNode` | | Author of the message being replied to. | | `replyColor?` | `string` | | Color of the reply bar. | | `onCancelReply?` | `() => void` | | When the reply is dismissed. | | `editing?` | `ChatMessage \| null` | | The message being edited. | | `onCancelEdit?` | `() => void` | | When editing is dismissed. | | `maxLength?` | `number` | | Maximum characters. | | `toolbar?` | `ReactNode` | | Extra buttons to the left of the input. | | `footer?` | `ReactNode` | | Content below the input. | | `onTyping?` | `() => void` | | Called while typing (at most once every 3 seconds): for the "typing…" status. | | `autoFocus?` | `boolean` | | Focus on mount. | | `ref?` | `Ref` | | Control functions. | | `messages?` | `Partial` | | Texts of this composer. | ### ChatMessages _type_ Texts of the chat components (`Chat`, `ChatComposer`, `EmojiPicker`). Replace them app-wide in the dictionary's `ui.chat` namespace, or for one chat with the `messages` prop. Placeholders such as `{count}` and `{name}` are filled at runtime. | Property | Type | Default | Description | | --- | --- | --- | --- | | `list` | `string` | `"Mesajlar"` | Screen reader name of the message list. | | `you` | `string` | `"Sen"` | Author of your own messages (in quotes, reactions). | | `unread` | `string` | `"{count} okunmamış mesaj"` | Unread messages separator. | | `jumpToLatest` | `string` | `"En yeni mesajlara git"` | Scroll down button. | | `newMessages` | `string` | `"{count} yeni mesaj"` | Count of new messages that arrived while scrolled up. | | `loadingOlder` | `string` | `"Eski mesajlar yükleniyor…"` | While older messages load. | | `edited` | `string` | `"düzenlendi"` | Note next to the time of an edited message. | | `deleted` | `string` | `"Bu mesaj silindi"` | Deleted message. | | `deletedOwn` | `string` | `"Bu mesajı sildin"` | Your own deleted message. | | `forwarded` | `string` | `"İletildi"` | Note above a forwarded message. | | `readMore` | `string` | `"Devamını oku"` | Link that expands a long message. | | `sending` | `string` | `"Gönderiliyor"` | Delivery status. | | `sent` | `string` | `"Gönderildi"` | Delivery status: single tick. | | `delivered` | `string` | `"Teslim edildi"` | Delivery status: double tick. | | `read` | `string` | `"Okundu"` | Delivery status: blue double tick. | | `failed` | `string` | `"Gönderilemedi. Yeniden denemek için dokun."` | Message that failed to send. | | `starred` | `string` | `"Yıldızlı"` | Starred message marker. | | `pinned` | `string` | `"Sabitlendi"` | Pinned message marker. | | `react` | `string` | `"Tepki ver"` | Reaction button. | | `reply` | `string` | `"Yanıtla"` | Reply action. | | `copy` | `string` | `"Kopyala"` | Copy action. | | `copied` | `string` | `"Kopyalandı"` | After copying. | | `edit` | `string` | `"Düzenle"` | Edit action. | | `delete` | `string` | `"Sil"` | Delete action. | | `forward` | `string` | `"İlet"` | Forward action. | | `star` | `string` | `"Yıldızla"` | Star action. | | `unstar` | `string` | `"Yıldızı kaldır"` | Unstar action. | | `pin` | `string` | `"Sabitle"` | Pin action. | | `unpin` | `string` | `"Sabitlemeyi kaldır"` | Unpin action. | | `retry` | `string` | `"Yeniden dene"` | Retry action. | | `regenerate` | `string` | `"Yeniden oluştur"` | Regenerate response action. | | `good` | `string` | `"İyi yanıt"` | Like button. | | `bad` | `string` | `"Kötü yanıt"` | Dislike button. | | `more` | `string` | `"Diğer"` | More actions menu. | | `moreReactions` | `string` | `"Diğer emojiler"` | + button in the reaction bar. | | `messageActions` | `string` | `"Mesaj eylemleri"` | Screen reader name of the action panel. | | `deleteTitle` | `string` | `"Mesaj silinsin mi?"` | Delete confirmation title. | | `deleteDescription` | `string` | `"Mesaj herkes için silinir."` | Delete confirmation description. | | `reactedBy` | `string` | `"{names} tepki verdi"` | Tooltip of a reaction chip. | | `typing` | `string` | `"{name} yazıyor…"` | While one person types. | | `typingTwo` | `string` | `"{a} ve {b} yazıyor…"` | While two people type. | | `typingMany` | `string` | `"{count} kişi yazıyor…"` | While three or more people type. | | `thinking` | `string` | `"Düşünüyor…"` | While thinking. | | `thought` | `string` | `"Düşünme"` | Thinking section of unknown duration. | | `thoughtFor` | `string` | `"{seconds} sn düşündü"` | Thinking duration. | | `toolRunning` | `string` | `"Çalışıyor"` | Tool running. | | `toolDone` | `string` | `"Tamamlandı"` | Tool finished. | | `toolError` | `string` | `"Hata"` | Tool failed. | | `toolInput` | `string` | `"Girdi"` | Tool input title. | | `toolOutput` | `string` | `"Çıktı"` | Tool output title. | | `sources` | `string` | `"Kaynaklar"` | Sources list. | | `errorTitle` | `string` | `"Yanıt alınamadı"` | Default text of the error box. | | `placeholder` | `string` | `"Mesaj yaz"` | Placeholder of the input in messaging. | | `placeholderAssistant` | `string` | `"Bir şey sor…"` | Placeholder in AI chat. | | `send` | `string` | `"Gönder"` | Send button. | | `stop` | `string` | `"Durdur"` | Stop response button. | | `attach` | `string` | `"Dosya ekle"` | Attach file button. | | `emoji` | `string` | `"Emoji"` | Emoji button. | | `record` | `string` | `"Sesli mesaj kaydet"` | Record button. | | `sendRecording` | `string` | `"Sesli mesajı gönder"` | Finish and send the recording. | | `cancelRecording` | `string` | `"Kaydı sil"` | Cancel the recording. | | `recording` | `string` | `"Kaydediliyor"` | While recording. | | `micDenied` | `string` | `"Mikrofona erişilemedi"` | When there is no microphone permission. | | `replyingTo` | `string` | `"{name} yanıtlanıyor"` | Reply bar. | | `cancelReply` | `string` | `"Yanıtı iptal et"` | Close the reply bar. | | `editing` | `string` | `"Mesajı düzenliyorsun"` | Edit bar. | | `cancelEdit` | `string` | `"Düzenlemeyi iptal et"` | Close the edit bar. | | `removeFile` | `string` | `"{name} kaldır"` | Remove button in the attachment preview. | | `dropFiles` | `string` | `"Dosyaları buraya bırak"` | Drag and drop area. | | `tooManyFiles` | `string` | `"En fazla {max} dosya eklenebilir"` | When the file limit is exceeded. | | `fileTooLarge` | `string` | `"{name} çok büyük (en fazla {max})"` | When the size limit is exceeded. | | `fileNotAccepted` | `string` | `"{name} desteklenmiyor"` | When the type is not accepted. | | `voiceMessage` | `string` | `"Sesli mesaj"` | Voice message attachment. | | `photo` | `string` | `"Fotoğraf"` | Image attachment (in quotes). | | `video` | `string` | `"Video"` | Video attachment (in quotes). | | `file` | `string` | `"Dosya"` | File attachment (in quotes). | | `play` | `string` | `"Oynat"` | Play the voice message. | | `pause` | `string` | `"Duraklat"` | Pause the voice message. | | `speed` | `string` | `"Oynatma hızı"` | Speed button. | | `download` | `string` | `"İndir"` | Download the file. | | `openMedia` | `string` | `"Tam ekran aç"` | Open the image/video full screen. | | `moreMedia` | `string` | `"+{count}"` | Count of attachments that do not fit the grid. | | `emptyTitle` | `string` | `"Henüz mesaj yok"` | Empty messaging. | | `emptyAssistant` | `string` | `"Nasıl yardımcı olabilirim?"` | Empty AI chat. | | `suggestions` | `string` | `"Öneriler"` | Screen reader name of the suggestion chips. | | `emojiRecent` | `string` | `"Son kullanılanlar"` | Emoji category. | | `emojiSmileys` | `string` | `"Yüzler"` | Emoji category. | | `emojiPeople` | `string` | `"İnsanlar"` | Emoji category. | | `emojiNature` | `string` | `"Doğa"` | Emoji category. | | `emojiFood` | `string` | `"Yiyecek"` | Emoji category. | | `emojiActivity` | `string` | `"Etkinlik"` | Emoji category. | | `emojiTravel` | `string` | `"Seyahat"` | Emoji category. | | `emojiObjects` | `string` | `"Nesneler"` | Emoji category. | | `emojiSymbols` | `string` | `"Semboller"` | Emoji category. | ### ChatStreamPart _type_ A part coming from the stream. A plain text part (`string`) is appended to the response. - `{ type: "text", text }`: Text appended to the response. - `{ type: "reasoning", text }`: Text appended to the thinking section. - `{ type: "tool", id, ... }`: A tool call; the same `id` is updated. - `{ type: "source", url, title }`: Adds a source. - `{ type: "message", message }`: Changes message fields directly (e.g. `{ attachments }`, `{ body }`). - `{ type: "error", error }`: The response ends with an error. ```ts type ChatStreamPart = string | { type: "text"; text: string; } | { type: "reasoning"; text: string; } | ({ type: "tool"; } & ChatToolCall) | ({ type: "source"; } & ChatSource) | { type: "message"; message: Partial>; } | { type: "error"; error: string; } ``` ### ChatDate _type_ Values accepted as dates: `Date`, an ISO string or milliseconds. ```ts type ChatDate = Date | string | number ``` ### ChatRole _type_ Role of the message author. - `"user"`: The person using the app (on the right). - `"assistant"`: The AI or the other party (on the left). - `"system"`: Small info line in the middle ("Ayşe joined the group"). ```ts type ChatRole = "user" | "assistant" | "system" ``` ### ChatToolCall _type_ A tool call by the AI. ```ts type ChatToolCall = Core.ChatToolCall ``` ### ChatSource _type_ A source the response is based on. ```ts type ChatSource = Core.ChatSource ``` ### ChatLinkPreview _type_ Link preview. ```ts type ChatLinkPreview = Core.ChatLinkPreview ``` ### ChatMessage _type_ A chat message (same fields as web). ```ts type ChatMessage = Core.ChatMessage ``` ### ChatMessageStatus _type_ Delivery status of a message; shows as ticks next to the time of your own messages (like WhatsApp). - `"sending"`: Sending (clock icon). - `"sent"`: Reached the server (single tick). - `"delivered"`: Reached the recipient (double tick). - `"read"`: Read (blue double tick). - `"failed"`: Failed to send (red warning; tap to retry). ```ts type ChatMessageStatus = "sending" | "sent" | "delivered" | "read" | "failed" ``` ### ChatFile _type_ A file added to the composer. The app provides the picker (e.g. your own image picker); the component only shows and sends it. | Property | Type | Default | Description | | --- | --- | --- | --- | | `uri` | `string` | | URL of the file (`file://`, `content://`, `https://`). | | `name?` | `string` | | File name. | | `type?` | `string` | | MIME type (`image/jpeg`). | | `size?` | `number` | | Size (bytes). | | `width?` | `number` | | Image width (px). | | `height?` | `number` | | Image height (px). | ### ChatUser _type_ A person in the chat. | Property | Type | Default | Description | | --- | --- | --- | --- | | `id` | `string` | | Unique id; matches the messages' `authorId`. | | `name` | `string` | | Display name. | | `avatar?` | `string` | | Profile photo. | | `color?` | `string` | | Name color in group chats (e.g. `"#e11d48"`, `"var(--ui-primary)"`). When omitted, a stable color is picked from the id. | | `status?` | `"online" \| "away" \| "busy" \| "offline"` | | Online status; a dot on the avatar's corner. | ### ChatCustomAction _type_ Custom action added to the message menu. | Property | Type | Default | Description | | --- | --- | --- | --- | | `label` | `string` | | Display name. | | `icon?` | `IconProp` | | Icon. | | `tone?` | `"neutral" \| "danger"` | | Red (dangerous) action. | | `onSelect` | `(message: ChatMessage) => void` | | Called with the message when chosen. | | `when?` | `(message: ChatMessage) => boolean` | | Show only on these messages. | ### ChatAttachmentKind _type_ Attachment kind. When omitted, it is derived from `type` (MIME) or the file name. - `"image"`, `"video"`: Thumbnail in a grid; full screen on click. - `"audio"`: Voice message player (waveform, speed). - `"file"`: File card (icon, name, size, download). ```ts type ChatAttachmentKind = "image" | "video" | "audio" | "file" ``` ### ChatDraft _type_ Draft sent from the composer (same as web; files are `ChatFile`). | Property | Type | Default | Description | | --- | --- | --- | --- | | `text` | `string` | | Text (trimmed). | | `files` | `ChatFile[]` | | Attached files. | | `replyTo?` | `ChatMessage` | | The message being replied to. | ### ChatAttachment _type_ Message attachment: image, video, audio or file. | Property | Type | Default | Description | | --- | --- | --- | --- | | `id?` | `string` | | Unique id. When omitted, `url` or the name is used. | | `name?` | `string` | | File name. | | `url?` | `string` | | Address (download, playback, full screen). A local preview can be given while uploading. | | `type?` | `string` | | MIME type (e.g. `"image/png"`, `"audio/webm"`). | | `kind?` | `ChatAttachmentKind` | | Kind. See `ChatAttachmentKind`. | | `size?` | `number` | | Size (bytes). | | `thumbnail?` | `string` | | Thumbnail (shown in the grid instead of `url`). | | `width?` | `number` | | Natural width (px); when given, space is reserved before the image loads, so nothing shifts. | | `height?` | `number` | | Natural height (px). | | `duration?` | `number` | | Duration of audio and video (seconds). | | `waveform?` | `readonly number[]` | | Waveform of a voice message: samples between 0 and 1 (30-60 are enough). When omitted, a fixed pattern is drawn. | | `progress?` | `number` | | Upload progress (0-1). When given, a ring shows over the attachment. | ### ChatReaction _type_ A reaction: the emoji and who reacted. | Property | Type | Default | Description | | --- | --- | --- | --- | | `emoji` | `string` | | Emoji (e.g. `"👍"`). | | `users` | `readonly string[]` | | Ids of the people who reacted. The count is its length. | ### ChatReasoning _type_ A thinking step of the AI. | Property | Type | Default | Description | | --- | --- | --- | --- | | `text` | `string` | | Thinking text (Markdown). | | `duration?` | `number` | | Thinking duration (seconds); written as "Thought for 12 s". | ### ChatActionName _type_ Names of the actions on a message. `ChatProps.actions` picks which actions show. ```ts type ChatActionName = "react" | "reply" | "copy" | "edit" | "delete" | "forward" | "star" | "pin" | "retry" | "regenerate" | "feedback" ``` ### ChatStatus _type_ Chat state (AI). While `"submitted"` and `"streaming"`, the send button becomes "Stop". - `"ready"`: Ready. - `"submitted"`: Request sent, waiting for the first part (three dots). - `"streaming"`: The response is streaming. - `"error"`: The last request failed. ```ts type ChatStatus = "ready" | "submitted" | "streaming" | "error" ``` ### ChatSendContext _type_ Info passed to `UseChatOptions.send`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `messages` | `ChatMessage[]` | | History to respond to: the last message is the user's new message. | | `signal` | `AbortSignal` | | Aborted when "Stop" is pressed; pass it to `fetch`. | | `files` | `ChatFile[]` | | Files the user attached (to the last message). | ### ChatSendResult _type_ Responses the send function can return: a `fetch` response (read even if it does not stream; SSE, OpenAI and Anthropic formats are recognized), a stream, an `async function*` generator or text. ```ts type ChatSendResult = ChatStreamSource ``` ### UseChatOptions _type_ Options of `useChat` (same as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `send` | `(context: ChatSendContext) => ChatSendResult \| Promise` | | Produces the response. | | `initialMessages?` | `readonly ChatMessage[]` | | Initial messages. | | `parse?` | `(data: string) => ChatStreamPart \| null` | | Parsing of an SSE `data:` line. | | `onFinish?` | `(message: ChatMessage, messages: ChatMessage[]) => void` | | When the response ends (even if stopped). | | `onError?` | `(error: unknown) => void` | | When the request fails. | | `onFeedback?` | `(message: ChatMessage, value: "up" \| "down" \| null) => void` | | When the user gives 👍/👎. | | `attachment?` | `(file: ChatFile) => ChatAttachment \| Promise` | | Turns an added file into a message attachment (e.g. upload and return its URL). Defaults to the local URL. | | `generateId?` | `() => string` | | Generates a new message ID. | ### UseChatResult _type_ Result of `useChat` (same as web). | Property | Type | Default | Description | | --- | --- | --- | --- | | `messages` | `ChatMessage[]` | | Messages. | | `setMessages` | `(messages: ChatMessage[] \| ((current: ChatMessage[]) => ChatMessage[])) => void` | | Changes the messages directly. | | `status` | `ChatStatus` | | Status. | | `error` | `unknown` | | Last error. | | `send` | `(input: string \| ChatDraft) => Promise` | | Sends a message (text or a draft). | | `stop` | `() => void` | | Stops the streaming response. | | `regenerate` | `(message?: ChatMessage) => Promise` | | Regenerates the last (or the given) response. | | `edit` | `(message: ChatMessage, text: string) => Promise` | | Edits a user message and regenerates what follows. | | `props` | `{ messages: ChatMessage[]; status: ChatStatus; onSend: (draft: ChatDraft) => Promise; onStop: () => void; onRegenerate: (message: ChatMessage) => void; onRetry: (message: ChatMessage) => void; onEdit: (message: ChatMessage, text: string) => Promise; onFeedback: (message: ChatMessage, value: "up" \| "down" \| null) => void; }` | | Props to spread onto `Chat`: ``. | ## Checkbox ### Checkbox _component_ Checkbox (16 px box, same look as web). Can be used with a label, description and error message; the touch target is at least 44 px. `` ### CheckboxProps _type_ Props of `Checkbox`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `checked?` | `boolean` | | Checked (controlled). | | `defaultChecked?` | `boolean` | `false` | Initially checked (uncontrolled). | | `onCheckedChange?` | `(checked: boolean) => void` | | When the state changes. | | `indeterminate?` | `boolean` | | Partially selected (e.g. a "select all" box): a dash is shown. | | `label?` | `ReactNode` | | Label next to the box; all of it is tappable. | | `description?` | `ReactNode` | | Description below the label. | | `error?` | `ReactNode` | | Error message; the box is drawn in the danger color. | | `disabled?` | `boolean` | | Disabled. | | `name?` | `string` | | Name in the form. Inside `Form`, state, error and disabled come from the form. | | `accessibilityLabel?` | `string` | | Screen reader label (if the label is not text). | | `effect?` | `EffectProp` | | Effect of the box (`"ripple"`, `"bounce"`, `"pulse"`…). If omitted, `appearance.defaults.checkbox.effect`. See `BuiltinEffect`. | | `tooltip?` | `TooltipProp` | | Tooltip shown on press and hold. See `TooltipProp`. | | `style?` | `StyleProp` | | Container style. | ## CodeBlock ### CodeBlock _component_ Syntax-highlighted code block. The same highlighter, languages and theme colors (`theme.code`) as web's `CodeBlock`; looks the same on iOS and Android. Supports line numbers, highlighted / added / removed lines, horizontal scrolling or wrapping (`wrap`) for long lines, collapsing long code (`maxLines`), a diff between two pieces of code (`original`) and copying to the clipboard. ```tsx Hello; } `} /> ``` ### loadLanguage _function_ Loads a language's rules. The same language always gets the same Promise, marked the way React expects once resolved, so `use()` reads a loaded language right away without suspending. Resolves with `null` for an unknown language. ```ts loadLanguage(language: CodeLanguage): Promise ``` ### registerLanguage _function_ Adds your own language or replaces a built-in one. Rules are ordered; the first rule matching at a position wins. Call it once at app start. ```ts registerLanguage(name: string, grammar: CodeGrammar, label?: string): void ``` - name - Name used in the `language` prop (case insensitive). - grammar - The language rules. See `CodeRule`. - label - Name shown in the header. @defaultValue `name` ```ts registerLanguage("prisma", [ { type: "comment", pattern: /\/\/.+/ }, { type: "keyword", pattern: /\b(?:model|enum|datasource|generator)\b/ }, { type: "type", pattern: /\b(?:String|Int|Boolean|DateTime)\b/ }, { type: "meta", pattern: /@@?\w+/ }, ], "Prisma"); ``` ### CodeLineSelection _type_ Line selection: line numbers and ranges. Can be an array (`[1, [4, 6]]`) or a string (`"1,4-6"`). Numbers are the line numbers shown on screen (relative to `startLine`). ```ts type CodeLineSelection = string | readonly (number | readonly [number, number])[] ``` ### CodeBlockProps _type_ Props of `CodeBlock`. | Property | Type | Default | Description | | --- | --- | --- | --- | | `ref?` | `Ref` | | Ref of the underlying native element. | | `code` | `string` | | Code to show. A single leading and trailing empty line is trimmed. | | `language?` | `CodeLanguage` | | Highlighting language: `tsx`, `ts`, `js`, `json`, `html`, `css`, `bash`, `python`, `sql`, `md`, `yaml`, `diff`, `go`, `rust`, `java`, `kotlin`, `c`, `cpp`, `csharp`, `php`, `ruby`, `swift`, `graphql`, `dockerfile`, `toml`… The same highlighter and languages as web. An unknown name or `"text"` is shown as plain text. For your own language use `registerLanguage`. | | `title?` | `ReactNode` | | Title shown in the top bar, usually a file name (`"app/page.tsx"`). | | `icon?` | `IconProp` | | Icon to the left of the title: a name or an element. | | `header?` | `boolean` | | Show the top bar (title, language name, copy). @defaultValue `true` if there is a title, icon, language name or copy button | | `lineNumbers?` | `boolean` | `false`; `true` in diff mode (when `original` is given)` | Show line numbers. | | `startLine?` | `number` | `1` | Number of the first line. | | `highlightLines?` | `CodeLineSelection` | | Lines to highlight: `[3, [5, 7]]` or `"3,5-7"`. Ignored in diff mode. | | `addedLines?` | `CodeLineSelection` | | Lines to show as added (green). With `language="diff"`, `+` lines are marked automatically. | | `removedLines?` | `CodeLineSelection` | | Lines to show as removed (red). With `language="diff"`, `-` lines are marked automatically. | | `wrap?` | `boolean` | `false` | Wrap long lines instead of scrolling horizontally. | | `maxHeight?` | `number` | | Code taller than this height (pixels) scrolls vertically. | | `maxLines?` | `number` | | If the code is longer than this many lines, only the first lines are shown with a "Show all" button below. Ignored in diff mode. | | `original?` | `string` | | Old code to compare against. When given the block switches to diff mode: `code` is the new version, removed lines show in red, added ones in green, and words changed within a line are highlighted separately (the same Myers algorithm as web). The header shows `+added −removed` counts. It is a single-column view for phone screens (web's `"unified"`). | | `contextLines?` | `number \| false` | `3` | Number of unchanged lines shown around changes in diff mode; longer unchanged regions are folded and expand on press. `false` shows all. | | `copyable?` | `boolean` | `true` | Show the copy button. If the app has no clipboard module (`Clipboard`) the button does not appear. | | `onCopy?` | `(code: string) => void` | | Called with the copied text when the code is copied. | | `fontSize?` | `number` | `13` | Font size (pixels). | | `style?` | `StyleProp` | | Container style. | | `codeStyle?` | `StyleProp` | | Style of the code text (e.g. font). | ### CodeTokenType _type_ Highlighted token kinds. Each kind is colored by a `--ui-code-*` theme variable (e.g. `keyword` → `--ui-code-keyword`). ```ts type CodeTokenType = "comment" | "keyword" | "string" | "number" | "constant" | "function" | "type" | "builtin" | "variable" | "property" | "operator" | "punctuation" | "tag" | "attr" | "regex" | "meta" | "inserted" | "deleted" | "heading" | "bold" | "italic" | "link" ``` ### CodeRule _type_ A language rule. | Property | Type | Default | Description | | --- | --- | --- | --- | | `type?` | `CodeTokenType` | | Kind of the matched text; plain text when `undefined`. With `inside`, text the inner language cannot match gets this kind. | | `pattern` | `RegExp` | | Pattern to match. All rules combine into one expression with the `gm` flags (`^` and `$` are line start/end); the `i` flag is supported, others are ignored. Do not use back references (`\1`): numbers shift when combined; capture groups are fine. | | `inside?` | `CodeGrammar \| (() => CodeGrammar)` | | Also highlight the matched text with this language (e.g. `${…}` in a template string, `