Shell
Import
import { Shell } from '@resultadosdigitais/tangram-shell'
Properties
reservePrimarySpace
| Type | bool |
|---|---|
| Default | false |
Description
Reserva preventivamente o espaço destinado ao menu principal (ShellPrimary).
children
<ShellProduct />
Import
import { ShellProduct } from '@resultadosdigitais/tangram-shell'
Properties
as
| Type | elementType | string |
|---|
Description
Define o tipo de elemento a ser renderizado para este componente.
Por padrão, será renderizado um elemento <div />.
Se o componente tiver a propriedade href, será renderizado como um link <a />
independentemente do valor da propriedade as.
children
<ShellPrimary />
Import
import { ShellPrimary } from '@resultadosdigitais/tangram-shell'
Properties
expanded
defaultExpanded
| Type | bool |
|---|
Description
Define se o ShellPrimary deve iniciar expandido por padrão (modo não controlado).
hideToggle
| Type | bool |
|---|---|
| Default | false |
Description
Quando true, oculta o botão de expandir/recolher do menu primário.
Esse comportamento só tem efeito para telas grandes.
expandLabelText
| Type | string |
|---|---|
| Default | ShellPrimary.translations.en.expand |
Description
Texto customizado para o rótulo do botão de expandir/recolher quando o menu está recolhido. Este texto não será exibido na tela.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellPrimary.translations.en.expand, ShellPrimary.translations.ptBR.expand e ShellPrimary.translations.es.expand.
collapseLabelText
| Type | string |
|---|---|
| Default | ShellPrimary.translations.en.collapse |
Description
Texto customizado para o rótulo do botão de expandir/recolher quando o menu está expandido. Este texto não será exibido na tela.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellPrimary.translations.en.collapse, ShellPrimary.translations.ptBR.collapse e ShellPrimary.translations.es.collapse.
children
onToggle
| Type | func |
|---|---|
| Param | event React.SyntheticEvent - A origem do evento que acionou o callback. |
| Param | nextExpanded boolean - Indica se o menu pretende ser aberto (true) ou fechado (false). |
Description
Callback acionado quando o menu pretende ser expandido ou recolhido.
<ShellSecondary />
Import
import { ShellSecondary } from '@resultadosdigitais/tangram-shell'
Properties
children
<ShellAccount />
Import
import { ShellAccount } from '@resultadosdigitais/tangram-shell'
Properties
as
label 📍
avatarSrc
avatarBrand
avatarColor
badge
| Type | bool | number |
|---|---|
| Default | false |
Description
Define um Badge associado ao perfil.
Se booleano, aparece sem número; se um número, exibe a contagem.
badgeMaxValue
expanded
| Type | bool |
|---|
Description
Controla a visibilidade do dropdown associado ao ShellAccount (modo controlado).
defaultExpanded
| Type | bool |
|---|
Description
Define se o dropdown associado ao ShellAccount deve iniciar visível por padrão (modo não controlado).
tooltip
| Type | string |
|---|---|
| Default | ShellAccount.translations.en.tooltip |
Description
Define o texto do Tooltip do menu.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellAccount.translations.en.tooltip, ShellAccount.translations.ptBR.tooltip e ShellAccount.translations.es.tooltip.
active
| Type | bool |
|---|---|
| Default | false |
Description
Indica que o perfil está ativo. Defina esta propriedade como true quando um dos itens internos do dropdown associado estiver ativo.
readOnly
children
onToggle
| Type | func |
|---|---|
| Param | event React.SyntheticEvent - A origem do evento que acionou o callback. |
| Param | show boolean - Indica se o dropdown pretende ser exibido (true) ou escondido (false). |
Description
Callback acionado quando o dropdown associado pretende ser exibido ou escondido.
<ShellProducts />
Import
import { ShellProducts } from '@resultadosdigitais/tangram-shell'
Properties
expanded
| Type | bool |
|---|
Description
Controla a visibilidade do dropdown associado ao ShellProducts (modo controlado).
defaultExpanded
| Type | bool |
|---|
Description
Define se o dropdown associado ao ShellProducts deve iniciar visível por padrão (modo não controlado).
tooltip
| Type | string |
|---|---|
| Default | ShellProducts.translations.en.tooltip |
Description
Define o texto do Tooltip do menu.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellProducts.translations.en.tooltip, ShellProducts.translations.ptBR.tooltip e ShellProducts.translations.es.tooltip.
children
onToggle
| Type | func |
|---|---|
| Param | event React.SyntheticEvent - A origem do evento que acionou o callback. |
| Param | show boolean - Indica se o dropdown pretende ser exibido (true) ou escondido (false). |
Description
Callback acionado quando o dropdown associado pretende ser exibido ou escondido.
<ShellAlerts />
Import
import { ShellAlerts } from '@resultadosdigitais/tangram-shell'
Properties
children
<ShellAlertsPortal />
Import
import { ShellAlertsPortal } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Filhos do ShellAlertsPortal que serão transportados para a área de alertas do Shell.
<ShellContent />
Import
import { ShellContent } from '@resultadosdigitais/tangram-shell'
Properties
children
<ShellNav />
Import
import { ShellNav } from '@resultadosdigitais/tangram-shell'
Properties
children
<ShellNavGroup />
Import
import { ShellNavGroup } from '@resultadosdigitais/tangram-shell'
Properties
label
children
<ShellNavGroupLabel />
Import
import { ShellNavGroupLabel } from '@resultadosdigitais/tangram-shell'
Properties
children
<ShellNavItem />
Import
import { ShellNavItem } from '@resultadosdigitais/tangram-shell'
Properties
as
| Type | elementType |
|---|
Description
Define o tipo de elemento a ser renderizado para este componente.
Se o componente tiver a propriedade href, será renderizado como um link <a />
independentemente do valor da propriedade as.
label 📍
| Concerns | 📍 Required |
|---|---|
| Type | string |
Description
Define o rótulo, o texto principal exibido pelo componente.
auxiliaryText
prefix
suffix
badge
| Type | bool | number |
|---|---|
| Default | false |
Description
Define um Badge associado ao item.
Se booleano, aparece sem número; se um número, exibe a contagem.
badgeMaxValue
disabled
active
danger
| Type | bool |
|---|---|
| Default | false |
Description
Indica se o item é visualmente perigoso, isto é, que o usuário deve executar sua ação com atenção.
readOnly
expanded
| Type | bool |
|---|
Description
Controla a visibilidade do dropdown associado (modo controlado).
Só tem efeito quando:
childrennão está vazio, isto é, está associado a um submenu- O submenu associado for exibido como o primeiro nível em um dropdown e não um nível mais interno
defaultExpanded
| Type | bool |
|---|
Description
Define se o dropdown associado deve iniciar visível por padrão (modo não controlado).
Só tem efeito quando:
childrennão está vazio, isto é, está associado a um submenu- O submenu associado for exibido como o primeiro nível em um dropdown e não um nível mais interno
submenuLabelText
| Type | string |
|---|---|
| Default | ShellNavItem.translations.en.submenu |
Description
Texto customizado para o rótulo do ícone que indica presença de submenu. Este texto não será exibido na tela.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellNavItem.translations.en.submenu, ShellNavItem.translations.ptBR.submenu e ShellNavItem.translations.es.submenu.
backLabelText
| Type | string |
|---|---|
| Default | ShellNavItem.translations.en.back |
Description
Texto customizado para o rótulo do ícone para retroceder um nível de submenu. Este texto não será exibido na tela.
Valores pré-definidos para inglês, português do Brasil e espanhol estão disponíveis em
ShellNavItem.translations.en.back, ShellNavItem.translations.ptBR.back e ShellNavItem.translations.es.back.
renderItem
| Type | func |
|---|
Description
Define um componente customizado à ser renderizado no lugar do conteúdo padrão.
children
onToggle
| Type | func |
|---|---|
| Param | event React.SyntheticEvent - A origem do evento que acionou o callback. |
| Param | show boolean - Indica se o dropdown pretende ser exibido (true) ou escondido (false). |
Description
Callback acionado quando o dropdown associado pretende ser exibido ou escondido.
<ShellNavItemPrefix />
Import
import { ShellNavItemPrefix } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Conteúdo do componente, geralmente o conteúdo a ser exibido no início do ShellNavItem.
Se o ShellNavItemPrefix não possuir a propriedade children e estiver sendo
utilizado para construir o conteúdo de um ShellNavItem com a propriedade
prefix definida, o valor desta propriedade prefix será
automaticamente utilizada como valor para o conteúdo do ShellNavItemPrefix.
<Shell>
<Shell.Primary>
<Shell.Nav>
<Shell.Nav.Item
prefix={<Cog title="Cog icon" />}
label="Configuration"
renderItem={() => (
<>
<Shell.Nav.Item.Prefix />
<Shell.Nav.Item.Heading>
<Shell.Nav.Item.Label />
</Shell.Nav.Item.Heading>
</>
)}
/>
</Shell.Nav>
</Shell.Primary>
</Shell>
<ShellNavItemHeading />
Import
import { ShellNavItemHeading } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Conteúdo do componente, geralmente os
componentes ShellNavItemLabel e ShellNavItemAuxiliaryText.
<Shell>
<Shell.Primary>
<Shell.Nav>
<Shell.Nav.Item
prefix={<Cog title="Cog icon" />}
label="Configuration"
renderItem={() => (
<Shell.Nav.Item.Heading>
<Shell.Nav.Item.Label />
</Shell.Nav.Item.Heading>
)}
/>
</Shell.Nav>
</Shell.Primary>
</Shell>
<ShellNavItemLabel />
Import
import { ShellNavItemLabel } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Conteúdo do componente, uma string para o rótulo do ShellNavItemLabel.
Se o ShellNavItemLabel não possuir a propriedade children e estiver sendo
utilizado para construir o conteúdo de um ShellNavItem com a propriedade
label definida, o valor desta propriedade label será
automaticamente utilizada como valor para o conteúdo do ShellNavItemLabel.
<Shell>
<Shell.Primary>
<Shell.Nav>
<Shell.Nav.Item
prefix={<Cog title="Cog icon" />}
label="Configuration"
renderItem={() => (
<Shell.Nav.Item.Heading>
<Shell.Nav.Item.Label />
</Shell.Nav.Item.Heading>
)}
/>
</Shell.Nav>
</Shell.Primary>
</Shell>
<ShellNavItemAuxiliaryText />
Import
import { ShellNavItemAuxiliaryText } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Conteúdo do componente, geralmente uma string para o texto auxiliar do ShellNavItem.
Se o ShellNavItemAuxiliaryText não possuir a propriedade children e estiver sendo
utilizado para construir o conteúdo de um ShellNavItem com a propriedade
auxiliaryText definida, o valor desta propriedade auxiliaryText será
automaticamente utilizada como valor para o conteúdo do ShellNavItemAuxiliaryText.
<Shell>
<Shell.Primary>
<Shell.Nav>
<Shell.Nav.Item
prefix={<Cog title="Cog icon" />}
label="Configuration"
auxiliaryText="Configuration options"
renderItem={() => (
<Shell.Nav.Item.Heading>
<Shell.Nav.Item.Label />
<Shell.Nav.Item.AuxiliaryText />
</Shell.Nav.Item.Heading>
)}
/>
</Shell.Nav>
</Shell.Primary>
</Shell>
<ShellNavItemSuffix />
Import
import { ShellNavItemSuffix } from '@resultadosdigitais/tangram-shell'
Properties
children
| Type | node |
|---|
Description
Conteúdo do componente, geralmente o conteúdo a ser exibido no início do ShellNavItem.
Se o ShellNavItemSuffix não possuir a propriedade children e estiver sendo
utilizado para construir o conteúdo de um ShellNavItem com a propriedade
suffix definida, o valor desta propriedade suffix será
automaticamente utilizada como valor para o conteúdo do ShellNavItemSuffix.
<Shell>
<Shell.Primary>
<Shell.Nav>
<Shell.Nav.Item
prefix={<Agent title="Agent icon" />}
label="Agents gallery"
href="/agents-gallery"
target="_blank"
suffix={<External title="External link" size={External.sizes.xs} />}
renderItem={() => (
<>
<Shell.Nav.Item.Prefix />
<Shell.Nav.Item.Heading>
<Shell.Nav.Item.Label />
</Shell.Nav.Item.Heading>
<Shell.Nav.Item.Suffix />
</>
)}
/>
</Shell.Nav>
</Shell.Primary>
</Shell>
Feedback
To report a problem or suggest changes, use our improvements form or, if you prefer, open an issue on our Github repository.