Components
Import the three components from @rafaelaugusto/nitroui-vue. In the example this name resolves to the package in the workspace.
View
View creates a native container. Its default slot accepts child components. Use a layout object to set spacing and dimensions.
vue
<View :layout="{ padding: 20, gap: 8 }">
<Text>Account</Text>
<TextInput v-model="name" placeholder="Your name" />
</View>Text
Text creates a native label. Its default slot accepts strings and interpolations. Place text inside this component and keep nested native views inside a View.
| Prop | Type | Behavior |
|---|---|---|
fontSize | number | Positive font size. Defaults to 17. |
layout | Layout | Sets the label's layout. |
vue
<Text :fontSize="24">Hello, {{ name }}!</Text>TextInput
TextInput creates a single-line editable field. Programmatic updates call the native setter. Native edits emit the full current string.
| Prop or event | Type | Behavior |
|---|---|---|
modelValue | string | Current text. Removing the value clears the field. |
update:modelValue | (value: string) => void | Emitted on native edits. Use with v-model. |
placeholder | string | Hint shown while the field is empty. |
layout | Layout | Sets the input's dimensions and spacing. |
These two forms bind the same field:
vue
<TextInput v-model="name" />
<TextInput :modelValue="name" @update:modelValue="name = $event" />