MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Tab

Function Tab

packages/dev/s2-docs/src/Tabs.tsx:232–263  ·  view source on GitHub ↗
(props: TabProps)

Source from the content-addressed store, hash-verified

230});
231
232export function Tab(props: TabProps): ReactNode {
233 let contentId = useId();
234 let ariaLabelledBy = props['aria-labelledby'] || '';
235 return (
236 <RACTab
237 {...props}
238 // @ts-ignore
239 originalProps={props}
240 aria-labelledby={`${ariaLabelledBy}`}
241 className={renderProps => tab({...renderProps})}>
242 <Provider
243 values={[
244 [
245 TextContext,
246 {
247 id: contentId,
248 styles: style({order: 1})
249 }
250 ],
251 [
252 IconContext,
253 {
254 // render: centerBaseline({slot: 'icon', styles: style({order: 0})}),
255 styles: icon
256 }
257 ]
258 ]}>
259 {props.children}
260 </Provider>
261 </RACTab>
262 );
263}
264
265const tabPanel = style({
266 ...focusRing(),

Callers

nothing calls this directly

Calls 2

useIdFunction · 0.90
tabFunction · 0.50

Tested by

no test coverage detected