Clickablecomponent

Clickable(props: StylableClickableProps): ReactElement
ParamType
propsStylableClickableProps
Props for a clickable that also accepts a className for styling. required
Return
ReactElement

Render either a <button>, an <a href="">, or a plain <span> based on whether an onClick or href prop is provided.

  • href renders a LinkClickable; onClick renders a ButtonClickable; neither renders a SpanClickable.
  • Dispatches on defined values (not key presence) so wrappers can always spread href={href} through, even when it's undefined.

Examples

<Clickable href="/about">About</Clickable>
<Clickable onClick={save}>Save</Clickable>