ui:prop
View as MarkdownDeclares a prop of a component. Use it where you would write f:argument: it takes the same arguments and adds client and context.
<ui:prop name="variant" type="string" optional="{true}" default="primary" />
<ui:prop name="size" type="string" optional="{true}" default="medium" client="{true}" />
client works on a root component and context on its other parts. The other way round throws an exception.
All props from a root component are automatically exposed to the context.
Arguments
Permalink to heading "Arguments"| Name | Type | Description | Required | Default |
|---|---|---|---|---|
name |
string | name of the template argument | Yes | - |
type |
string | type of the template argument | Yes | - |
description |
string | description of the template argument | No | - |
optional |
boolean | true if the defined argument should be optional | No | false |
default |
mixed | default value for optional argument | No | - |
client |
boolean | Whether the property should be exposed to the client hydration data. See Hydration for more information. | No | false |
context |
boolean | Whether the property should be exposed to the components context. See Context for more information. | No | false |
requiredAtRuntime |
boolean | Whether the property is required at runtime. This means that the component will throw an error if the property is not defined when rendering. Primitives use it for props that a wrapper forwards with ui:useProps. | No | false |