Skip to main content

Clickable

The clickable component makes any content interactive. Use it to add click interactions to non-interactive elements while maintaining full control over their visual presentation.

Unlike the button component, clickable doesn't impose visual styling, allowing you to create custom interactive elements. You must implement focus indicators and other visual cues yourself.


Configure the following properties on the Clickable component.

Anchor to disabled
disabled
boolean

Whether the field is disabled, preventing user interaction. Use when the field is temporarily unavailable due to application state, permissions, or dependencies.

string

A unique identifier for the element used for targeting with CSS, JavaScript, or accessibility features.

The clickable component provides event callbacks for handling user interactions. Learn more about handling events.

Anchor to click
click
(event: <"s-clickable">) => void

The callback when the element is activated.


Anchor to Make content clickableMake content clickable

Make any content interactive using a clickable component wrapper without imposing visual styling. This example shows how to create custom interactive elements while maintaining full control over appearance.

Make content clickable

Make any content interactive using a clickable component wrapper without imposing visual styling. This example shows how to create custom interactive elements while maintaining full control over appearance.

Make content clickable

<s-clickable onClick="handleShippingSettings">
<s-box padding="base">
<s-text>View shipping settings</s-text>
</s-box>
</s-clickable>

  • Implement visual feedback: Since clickable has no built-in styling, add focus indicators and active states to show interactivity.
  • Wrap non-interactive elements: Use clickable for text, images, or icons. Avoid wrapping components with built-in interactions.
  • Handle disabled state carefully: When disabled, child elements can still receive focus. Provide visual feedback for the non-interactive state.

The component doesn't automatically provide keyboard navigation support beyond basic click functionality.


Was this page helpful?