Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@leafygreen-ui/button
Advanced tools
yarn add @leafygreen-ui/button
npm install @leafygreen-ui/button
Package | Version |
---|---|
@leafygreen-ui/leafygreen-provider | ^1.1.0 |
import Button from '@leafygreen-ui/button';
<Button
variant="primary"
className="create-item-button"
title="Create an item"
onClick={event => {
/* Something to handle the click event */
}}
>
Submit
</Button>;
Output HTML
<button
class="css-1rgbgdt create-item-button"
title="Create an item"
disabled="false"
>
Submit
</button>
Prop | Type | Description | Default |
---|---|---|---|
variant | 'default' | 'primary' | 'info' | 'danger' | 'dark' | Sets the style variant of the button. | 'default' |
darkMode | boolean | Determines if the component renders in dark mode | false |
size | 'xsmall' | 'small' | 'normal' | 'large' | Sets the size variant of the button. | 'normal' |
children | node | The content that will appear inside of the <Button /> component. | null |
onClick | function | The event handler function for the 'onclick' event. Receives the associated event object as the first argument. | |
borderRadius | string | Specify the border radius of the button. The string format is that which can be passed directly to a border-radius CSS property. | '3px' |
className | string | Adds a className to the class attribute. | '' |
value | string | Sets the HTML value attribute. | |
disabled | boolean | Disabled the button | false |
as | React.ElementType | Determines the root element. For example, Link or a tags can be supplied to replace button from being the DOM element that wraps the component. | button |
href | string | If a href is supplied it will change the as value, such that the component renders inside of an a tag instead of inside of a button tag. | |
glyph | React.ReactElement | When supplied a rendered Icon, renders a button with the specified glyph on the left-side of the content, and adjusts Button padding accordingly. | |
forceState | { focused?: boolean, active?: boolean } | Force the component to display the specified interaction states. | |
... | React.ComponentPropsWithRef<[as]> | Any other properties will be spread on the root element |
Note: In order to make this Component act as a submit button, the recommended approach is to pass submit
as the type
prop. Note it is also valid to pass input
to the as
prop, and the button's content's to the value
prop -- in this case, do not supply children to the component.
FAQs
leafyGreen UI Kit Button
The npm package @leafygreen-ui/button receives a total of 0 weekly downloads. As such, @leafygreen-ui/button popularity was classified as not popular.
We found that @leafygreen-ui/button demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.