
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@contentful/f36-button
Advanced tools
import { Props } from '@contentful/f36-docs-utils';
Buttons communicate the action that will occur when the user clicks them. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. They contain a text label to describe the action, and an icon if appropriate.
<>
<Grid rowGap="spacingXs" rows="repeat(4, auto)" justifyContent="start">
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="negative">Negative</Button>
<Button variant="positive">Positive</Button>
<Button variant="transparent">Transparent</Button>
</Grid>
Buttons can be used in couple of different variations, like active, disabled or loading. It's worthy mentioning is indicateDropdown
property in the component,
which enables the chevron icon on the right side of the button.
Using icon
property in the Button on the other hand, enables choosen icon on the left side of the button.
Contentful buttons are available in 3 different sizes:
<Grid columnGap="spacingXs" columns="repeat(3, auto)" justifyContent="start">
<Button size="large">Large</Button>
<Button size="medium">Medium</Button>
<Button size="small">Small</Button>
</Grid>
// import { Button } from '@contentful/f36-button';
<Button variant="primary" testId="create-content-type-empty-state">
Add content type
</Button>
Usage of the button with dropdown indication
// import { Button } from '@contentful/f36-button';
// import { DownloadIcon } from '@contentful/f36-icons';
<Button variant="primary" icon={<DownloadIcon />}>
Primary star
</Button>
Icon Button
// import { Button } from '@contentful/f36-button';
// import { DownloadIcon } from '@contentful/f36-icons';
<Button variant="primary" aria-label="Download Asset" icon={<DownloadIcon />} />
Button component is used to trigger an action or event. By default button is implemented using the native <button>
element with the proper type="button" provided. If the href element is provided, then the element would be rendered as <a>
element in the document.
When a button has focus, both the Space and Enter keys will activate the button. If the button is disabled, then the disabled attribute is provided.
Contentful buttons are checked in terms of color contrast and pass all the requirements.
Buttons have a focus state when using keyboard navigation.
Icon buttons must always have aria-label
that describes it's purpose when no text is provided
FAQs
Forma 36: Button component
The npm package @contentful/f36-button receives a total of 35,109 weekly downloads. As such, @contentful/f36-button popularity was classified as popular.
We found that @contentful/f36-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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.