Socket
Socket
Sign inDemoInstall

@paprika/raw-button

Package Overview
Dependencies
7
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/raw-button


Version published
Maintainers
3
Created

Readme

Source

@paprika/raw-button

Description

Raw button component, for performing an action on the page you’re viewing.

Installation

yarn add @paprika/raw-button

or with npm:

npm install @paprika/raw-button

Props

RawButton

PropTyperequireddefaultDescription
a11yTextstringfalsenullDescriptive a11y text for assistive technologies. By default, text from children node will be used.
canPropagateboolfalsetrueIf click events are allowed to propagate up the DOM tree.
childrennodetrue-Body content of the button.
hasInsetFocusStyleboolfalsefalseIf the visual focus ring should be displayed with an inset style.
isActiveboolfalsenullIf the button is in an "active" or "selected" state.
isDisabledboolfalsefalseIf the button is disabled.
onClickfuncfalse() => {}Callback to be executed when the button is clicked or activated by keyboard. Typically required.
rolestringfalse"button"Value for role attribute to override the default of "button".
tabIndexnumberfalsenullValue for tabindex attribute to override the default of 0.

RawButton

The <RawButton> component is a fully accessible button, rendered with almost no styling as a generic <span> element. It is intended for use any time click actions are needed for a UI element that is not visually represented as a skeuomorphic button.

For accessibility, the role="button", tabIndex="0", and aria-disabled="false" attributes are added by default, but can be overridden. An aria-label can be included via the a11yText prop, a visual focus ring is applied, and keyboard listeners are included that will fire the onClick function when the user activates the component with an enter or space keypress.

Usage

import RawButton from "@paprika/raw-button";

<RawButton onClick={clickHandler}>Visible click target</RawButton>;
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Last updated on 18 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc