Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paprika/raw-button

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/raw-button

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

  • 0.2.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4K
decreased by-17.02%
Maintainers
4
Weekly downloads
 
Created
Source

@paprika/raw-button - 0.2.19

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
  • Github create issue
  • ChangeLog

FAQs

Package last updated on 17 Sep 2020

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc