/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/elevation/component.tsx
41 строка
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import type { ForwardedRef } from 'react'; import type { WordPressComponentProps } from '../context'; import { contextConnect } from '../context'; import { View } from '../view'; import { useElevation } from './hook'; import type { ElevationProps } from './types'; function UnconnectedElevation( props: WordPressComponentProps< ElevationProps, 'div' >, forwardedRef: ForwardedRef< any > ) { const elevationProps = useElevation( props ); return <View { ...elevationProps } ref={ forwardedRef } />; } /** * `Elevation` is a core component that renders shadow, using the component * system's shadow system. * * The shadow effect is generated using the `value` prop. * * ```jsx * import { * __experimentalElevation as Elevation, * __experimentalText as Text, * } from '@wordpress/components'; * * function Example() { * return ( * <div> * <Text>Code is Poetry</Text> * <Elevation value={ 5 } /> * </div> * ); * } * ``` */ export const Elevation = contextConnect( UnconnectedElevation, 'Elevation' ); export default Elevation;