
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@zendeskgarden/container-selection
Advanced tools
Containers relating to selection in the Garden Design System
This package includes containers relating to selection in the Garden Design System.
npm install @zendeskgarden/container-selection
For live examples check out our storybook.
The useSelection
hook which manages an items focus state including keyboard controls,
aria attributes and RTL support. It uses the
roving tab index strategy.
import { useSelection } from '@zendeskgarden/container-selection';
const items = ['Item 1', 'Item 2', 'Item 3'];
const Selection = ({ direction }) => {
const { focusedItem, selectedItem, getContainerProps, getItemProps } = useSelection({
direction
});
return (
<ul {...getContainerProps()}>
{items.map(item => {
const ref = React.createRef();
const isSelected = selectedItem === item;
const isFocused = focusedItem === item;
return (
<li
{...getItemProps({
key: item,
item,
ref,
focusRef: ref
})}
>
{item}
{isSelected && <div>[Selected]</div>}
{isFocused && <div>(Focused)</div>}
</li>
);
})}
</ul>
);
};
import { SelectionContainer } from '@zendeskgarden/container-selection';
const items = ['Item 1', 'Item 2', 'Item 3'];
<SelectionContainer direction="vertical">
{({ selectedItem, focusedItem, getContainerProps, getItemProps }) => (
<ul {...getContainerProps()}>
{items.map(item => {
const ref = React.createRef();
const isSelected = item === selectedItem;
const isFocused = item === focusedItem;
return (
<li
{...getItemProps({
key: item,
item,
ref,
focusRef: ref
})}
>
{item}
{isSelected && <span> - Selected</span>}
{isFocused && <span> - Focused</span>}
</li>
);
})}
</ul>
)}
</SelectionContainer>;
FAQs
Containers relating to selection in the Garden Design System
The npm package @zendeskgarden/container-selection receives a total of 18,226 weekly downloads. As such, @zendeskgarden/container-selection popularity was classified as popular.
We found that @zendeskgarden/container-selection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.