UI
Overview
View components provided by OneScript.
Create views with TSX components from onescript/views.
| Component | Purpose |
|---|---|
Text | Displays text. |
DateText | Displays a JavaScript Date with a system date style. |
CodeBlock | Display code with syntax highlighting. App only. |
Markdown | Render Markdown text. App only. |
Image | Displays an image from a Data URL, URL, or Request. |
Symbol | Displays an SF Symbol or Pika icon. |
Label | Pairs a title with an icon. |
ProgressView | Shows the progress of a task. |
Button | Runs an App callback or Widget action. |
Menu | Shows a list of actions when tapped. App only. |
TextField | Accepts text input. |
SecureField | Accepts a password or other private text. App only. |
TextEditor | Edits long, multiline text. App only. |
Toggle | Switches a boolean value on or off. |
Picker | Chooses one value from a set of options. |
Slider | Selects a value from a continuous range. |
Stepper | Increments or decrements a value. |
DatePicker | Chooses a date, a time, or both. App only. |
Link | Opens a URL with the system. App only. |
ShareLink | Shares text or a URL with the share sheet. App only. |
EditButton | Toggles edit mode, for example for List multiple selection. |
Spacer | Occupies available space inside a Stack. |
Divider | Draws a horizontal or vertical separator. |
Every view accepts Modifiers. Unsupported view types show a localized error message.
How is this guide?
Last updated on