Cursor API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
Cursor10 props0 callbacks0 methods
Preset and CSS
Set preset.className to attach your CSS class to the component's rendered surface. Explicit component props take precedence over preset options.
CSS parts in the example [data-part="root"]
Use styles.root and styles.parts in a theme and generate a CSS file with themeToCss. For other JSON-friendly component props, spread presetProps(preset) before explicit props. Parts and states depend on configuration; the gallery shows those visible in the current preview.
Props10
| Name | Type | Description |
|---|---|---|
positionOptional |
| Position in a containing surface established by the host. Omit to lay out inline. |
colorOptional | string | undefined | Any CSS color. Defaults to the theme accent. |
nameOptional | string | undefined | Collaborator name for the default label. |
messageOptional | string | undefined | Optional localized message for the default label. |
animateOptional | boolean | undefined | Animate updates to the provided position using the theme motion settings. |
childrenOptional |
| Custom cursor parts. Omit to use the shared default pointer and label. |
aria-hiddenOptional |
| Hide the cursor from assistive technology when presence is already listed elsewhere. |
styleOptional |
| Additional CSS styling, including caller-managed coordinates when position is omitted. |
presetOptional |
| Optional presentation preset. |
classNameOptional | string | undefined | Additional root class names. |
Events and callbacks0
No component-specific events or callbacks.
Methods0
No component-specific imperative methods. Use props and callbacks to control this component.