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

Function AIButton

packages/@react-spectrum/ai/src/AIButton.tsx:242–257  ·  view source on GitHub ↗
({size = 'M', brandColor, children, ...otherProps}: AIButtonProps)

Source from the content-addressed store, hash-verified

240 * An AIButton triggers an AI-powered action with a customizable branded appearance.
241 */
242export function AIButton({size = 'M', brandColor, children, ...otherProps}: AIButtonProps) {
243 let ref = useRef<HTMLButtonElement | null>(null);
244 return (
245 <Button
246 {...otherProps}
247 ref={ref}
248 className={renderProps => bg + button({size, ...renderProps})}
249 // eslint-disable-next-line react/react-compiler
250 style={pressScale(ref, {'--brand': brandColor} as CSSProperties)}>
251 <IconContext.Provider value={{styles: style({size: fontRelative(16), flexShrink: 0})}}>
252 <AIIcon />
253 </IconContext.Provider>
254 {children && <span>{children}</span>}
255 </Button>
256 );
257}
258
259const AIIcon = createIcon(props => {
260 return (

Callers

nothing calls this directly

Calls 2

pressScaleFunction · 0.90
fontRelativeFunction · 0.90

Tested by

no test coverage detected