About
外観、配置、サイズは、utility (ユーティリティ) クラスを使用して簡単にカスタマイズすることができます。
Border spinne
Border spinner (ボーダースピナー) を使用して軽量なローディングインジケーターを実現します。
<template>
<Spinner />
</template>
Colors
Spinner
コンポーネントに text-color
属性を使用します。
標準のスピナーでは、 text color utilitites
を使用することができます。
<template>
<Spinner text-color="primary" />
<Spinner text-color="secondary" />
<Spinner text-color="success" />
<Spinner text-color="danger" />
<Spinner text-color="warning" />
<Spinner text-color="info" />
<Spinner text-color="light" />
<Spinner text-color="dark" />
</template>
Growing spinner
grow spinner (グロースピナー) も用意されています。動きは下記を参考にしてください。
<template>
<Spinner spinner="grow" />
</template>
繰り返しますが、このスピナーはtext-color
で作られていますので、[text color utilities][color]で簡単に外観を変えることができます。ここでは、サポートされているバリエーションとともに、青で表示しています。
<template>
<Spinner
spinner="grow"
text-color="primary"
/>
<Spinner
spinner="grow"
text-color="secondary"
/>
<Spinner
spinner="grow"
text-color="success"
/>
<Spinner
spinner="grow"
text-color="danger"
/>
<Spinner
spinner="grow"
text-color="warning"
/>
<Spinner
spinner="grow"
text-color="info"
/>
<Spinner
spinner="grow"
text-color="light"
/>
<Spinner
spinner="grow"
text-color="dark"
/>
</template>
Alignment
rem
, text-color
, display: inline-flex
で構築されています。
簡単にサイズを変更したり、色を変更したり、素早く整列させることができます。
Margin
mergin="5"
margin utilities
で簡単にスペースを追加できます。
<template>
<Spinner :mergin="5" />
</template>
Placement
flexbox utilities
, float utilites
, text alignment
を使用して、配置することができます。
Flex
<template>
<b-div
flex
justify-content="center"
>
<Spinner>
<b-span visually-hidden>
Loading...
</b-span>
</Spinner>
</b-div>
</template>
<template>
<b-div
flex
align-items="center"
>
<strong>Loading...</strong>
<Spinner
aria-hidden="true"
margin="s-auto"
/>
</b-div>
</template>
Floats
<template>
<b-div clearfix>
<Spinner float="end" />
</b-div>
</template>
Text align
<template>
<b-div text-alignment="center">
<Spinner />
</b-div>
</template>
Size
sm
属性を追加して、サイズの変更ができます。
<template>
<Spinner sm />
<Spinner
spinner="grow"
sm
/>
</template>
カスタムCSSやインラインスタイルを使用して、必要に応じて寸法を変更することができます。
<template>
<Spinner style="width: 3rem; height: 3rem" />
<Spinner
spinner="grow"
style="width: 3rem; height: 3rem"
/>
</template>
Buttons
ボタンの中でスピナーを使用して、アクションが現在処理中または実行中であることを示します。
<template>
<b-button
color="primary"
disabled
>
<Spinner
sm
aria-hidden="true"
/>
</b-button>
<b-button
color="primary"
disabled
>
<Spinner
sm
aria-hidden="true"
/>
Loading...
</b-button>
</template>
<template>
<b-button
button
color="primary"
disabled
>
<Spinner
spinner="grow"
sm
aria-hidden="true"
/>
</b-button>
<b-button
button
color="primary"
disabled
>
<Spinner
spinner="grow"
sm
aria-hidden="true"
/>
Loading...
</b-button>
</template>