본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Masthead

원문 보기 위키 갱신

출처: 문서

본문

To maintain proper layout and formatting, a should contain both a and component. Mastheads contain the that wraps a and. The wraps. The masthead also contains the page's header toolbar within ``.

Examples

Basic

Logo

Content

Basic with mixed content

Logo

Content

Display inline

Logo

Content

Display stack

Logo

Content

Display stack, display inline responsive

Logo

Content

Inset

Logo

Content

Custom logo component

In addition to being able to pass a string to the component property of MastheadLogo, you can provide more fine-tuned customization by passing a callback that returns a component.

Content

Using router links

Router links can be used for in-app linking in React environments to prevent page reloading. To use a Link component from a router package, you can follow our custom logo component example and pass a callback to the component property of the MastheadLogo:

<MastheadLogo component={(props) => <Link {...props} to="#" />}>
  <Brand ...brandProps />
</MastheadLogo>

Props

Masthead

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead

| className | string | | Additional classes added to the masthead

| display | { default?: 'inline' | 'stack'; sm?: 'inline' | 'stack'; md?: 'inline' | 'stack'; lg?: 'inline' | 'stack'; xl?: 'inline' | 'stack'; '2xl'?: 'inline' | 'stack'; } | { md: 'inline' } | Display type at various breakpoints

| inset | { default?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; sm?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; md?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; lg?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; xl?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; '2xl'?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl'; } | | Insets at various breakpoints

| variant Beta | 'default' | 'docked' | 'default' | Indicates the variant of the masthead

MastheadToggle

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead toggle.

| className | string | | Additional classes added to the masthead toggle.

MastheadMain

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead main block.

| className | string | | Additional classes added to the masthead main.

MastheadBrand

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead brand.

| className | string | | Additional classes added to the masthead brand.

MastheadLogo

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead logo.

| className | string | | Additional classes added to the masthead logo.

| component | React.ElementType | React.ComponentType | | Component type of the masthead logo.

| isCompact Beta | boolean | false | Flag indicating the logo is a compact variant. Used in docked layouts.

MastheadContent

*required | | Name | Type | Default | Description | children | React.ReactNode | | Content rendered inside of the masthead content block.

| className | string | | Additional classes added to the masthead content.

Edit this page on GitHub

더 알아보기 (Learn more)