Block
The Block component is a structural element designed to act as an element container. The Block component is meant to be used as a wrapper of your other components for logical or styling purposes.
The default use case for the Block component is as an element container.
import Bottom from '@components/Layout/Bottom/Bottom';import Block from '@components/Layout/Block/Block';
const App = () => { return ( <Block> <Bottom>Bottom Content</Bottom> </Block> );};
export default App;| Prop Name | Type | Default | Description |
|---|---|---|---|
style | JSX.CSSProperties | {} | Inline styles to apply directly to the component’s root element. |
class | string | "" | Additional CSS classes to apply to the component |
ref | HTMLDivElement | undefined | Retrieves the component’s DOM element and assigns it to a variable. |
onAction | Record<string, (scope?: string, ...args: any[]) => void> | undefined | Allows you to add custom navigation action handlers to the component. See the Navigation component documentation for details. |
anchor | string | HTMLElement | undefined | Links navigation to another element. When the anchor element is focused, this component’s actions will execute. Can be a CSS selector or HTMLElement. |
Accessing the HTML element
Section titled “Accessing the HTML element”To access the HTML DOM element of the Block component.
- Declare a variable to hold the ref but don’t initialize it with a value
- The declared value should have a type of
HTMLDivElement - Set the declared variable as the value of the
refprop of theBlockcomponent
Example
Section titled “Example”import Bottom from '@components/Layout/Bottom/Bottom';import Block from '@components/Layout/Block/Block';
const App = () => { let blockRef!: HTMLDivElement
return ( <Block ref={blockRef}> <Bottom>Bottom Section</Bottom> </Block> );};Now you can access the HTML element of Block with blockRef and make modifications to it if needed.
© 2026 Coherent Labs. All rights reserved.