Spacer
danger
This component will be marked as deprecated and removed in an upcoming version of the component library.
Please avoid using this component in new implementations and consider replacing its current implementation
with dhl-grid-container
in combination with dhl-grid-cell
.
A layout utility Spacer
component, used in conjuction with the Flex
component to span 100% of the available empty space
between child components.
Import
- React
- Angular
- Vue.js
// with @dhl-official/react-library:
import { DhlSpacer } from "@dhl-official/react-library"
// with @dhl-official/ui-libraries/react-library:
import { DhlSpacer } from "@dhl-official/ui-libraries/react-library"
If the DUIL has been installed, you can use the web component directly:
<dhl-spacer></dhl-spacer>
// with @dhl-official/vue-library:
import { DhlSpacer } from "@dhl-official/vue-library"
// with @dhl-official/ui-libraries/vue-library:
import { DhlSpacer } from "@dhl-official/ui-libraries/vue-library"
Code
- React
- Angular
- Vue.js
<DhlFlex>
<DhlButton>0</DhlButton>
<DhlButton>1</DhlButton>
<DhlSpacer />
<DhlButton>2</DhlButton>
<DhlButton>3</DhlButton>
</DhlFlex>
<dhl-flex>
<dhl-button>0</dhl-button>
<dhl-button>1</dhl-button>
<dhl-spacer />
<dhl-button>2</dhl-button>
<dhl-button>3</dhl-button>
</dhl-flex>
<dhl-flex>
<dhl-button>0</dhl-button>
<dhl-button>1</dhl-button>
<dhl-spacer />
<dhl-button>2</dhl-button>
<dhl-button>3</dhl-button>
</dhl-flex>
info
It is highly recommended to use Design Tokens for spacing values.
However, other valid values are supported if passed as string e.g. "auto" or "12px" for custom cases.
Interactive Demo
Readme
Built by DHL User Interface Library Team!