Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@leafygreen-ui/box
Advanced tools
Box
is a polymorphic component that renders a given component depending on the provided props.
For example, providing the href
prop can indicate Box
should be rendered as an anchor tag.
Providing the component
prop indicates that Box
should be rendered as the component referenced by component
.
By default, Box
will render as the HTML element div
.
This can be useful for simplifying components that are repetitively used, but need different behaviors.
yarn add @leafygreen-ui/box
npm install @leafygreen-ui/box
import Box from '@leafygreen-ui/box';
<Box href="https://mongodb.design">I shall render as a link</Box>;
Output HTML
<a href="https://mongodb.design">I shall render as a link</a>
Prop | Type | Description | Default |
---|---|---|---|
as | HTMLElement or React.ReactElement | The component or HTML tag to be rendered by the <Box /> component. Note: This will supersede the behavior of any other props. | div |
href | string | When provided, <Box /> will render an anchor tag with this href value. | |
children | React.ReactElement | Content to be rendered in an HTML element, or provided as a prop to the rendered component |
Any other properties will be spread on the rendered HTML element or component.
FAQs
leafyGreen UI Kit Box
We found that @leafygreen-ui/box demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.