
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
The @bento/box package provides the shared React context that is used throughout
the Bento component ecosystem. It includes the Box context for managing component
environment and slots, and the Slot component for easily passing slot props to children.
[!DANGER]
The
Boxcontext is not meant to be used directly in your application. It is used internally by the Bento component ecosystem to manage the component environment and slots.
To install the package, use the following command:
npm install --save @bento/box
The Slot component is a convenience wrapper that simplifies passing slot props to
children via the Box context. This is particularly useful when building coordinator
components that need to distribute props to multiple children through the slot system
and does not introduce children as part of it's composition.
[!DANGER]
You should be using the
slotsprops instead of theSlotcomponent. This component is only meant to be used when composing components that do not introduce their own children as part of it's composition.
import { Slot } from '@bento/box';
const Example = withSlots('Example', function MyComponent(args) {
const { props } = useProps(args);
const slots = {
trigger: { onClick: handleClick },
content: { role: 'dialog' }
};
return (
<Slot slots={slots}>
{props.children}
</Slot>
);
}
<Source language='tsx' code={ SourceSlot } />
The Slot component:
slots prop containing slot assignmentsBox.ProviderChildren that use the slot prop (via @bento/slots) or useProps hook will
automatically receive the appropriate slot props.
The Slot component is ideal for:
Coordinator Components: Components that manage state and pass handlers to children
const Example = withSlots('Example', function Overlay(args) {
const { props } = useProps(args);
const slots = {
trigger: { onClick: () => props.onOpenChange(true) },
backdrop: { onClick: () => props.onOpenChange(false) },
content: { role: 'dialog', 'aria-modal': true }
};
return <Slot slots={slots}>{props.children}</Slot>;
});
Compound Components: Components that need to distribute props across multiple child types
const Example = withSlots('Example', function Tabs(args) {
const { props } = useProps(args);
const slots = {
tab: {
'aria-selected': (tab) => tab === props.activeTab,
onClick: (tab) => props.onChange(tab)
},
panel: {
hidden: (panel) => panel !== props.activeTab
}
};
return <Slot slots={slots}>{props.children}</Slot>;
});
When multiple Slot components are nested, slots are merged with child values
taking precedence over parent values:
<Slot slots={{ trigger: { value: 'parent' } }}>
<Slot slots={{ trigger: { value: 'child' } }}>
{/* trigger slot will have value: 'child' */}
</Slot>
</Slot>
New slots from children are added to existing parent slots:
<Slot slots={{ trigger: { onClick: handler1 } }}>
<Slot slots={{ content: { role: 'dialog' } }}>
{/* Both trigger and content slots are available */}
</Slot>
</Slot>
import { Box } from '@bento/box';
The Box context is a React context that provides Bento-specific configuration
to child components. It is typically used internally and does not require direct
interaction in most cases.
@bento/slots and @bento/use-props packages.@bento/environment component.The Box context is used to pass down the Bento specific configuration down to
the child components. This is done automatically for you, for the majority of
the cases you don't need to interact or use this context directly in your
application.
<Source language='tsx' code={ SourceNamespace } />
The above example would output the following:
The package exposes a defaults function that will return the default assigned
values for the Box context. You can use this if you need to provide your
components with a custom Box.Provider
import { Box, defaults } from '@bento/box';
import { useContext } from 'react';
function MyComponent() {
return (
<Box.Provider value={defaults()}>
<MyChildComponent />
</Box.Provider>
);
};
The Box context contains a slots object which is consumed by the
@bento/slots and @bento/use-props packages. This object
contains the following properties:
The env object contains @bento/environment specific configuration. The
object contains the following properties:
FAQs
Shared context for Bento components
The npm package @bento/box receives a total of 8 weekly downloads. As such, @bento/box popularity was classified as not popular.
We found that @bento/box demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.