Inkline includes multiple predefined modal styles, each serving its own semantic purpose. You can set the style of a <IModal> using the color property. By default, modals use the light variant.
Preview
Component.vue
<script>
exportdefault {
data() {
return {
primary: false,
secondary: false,
light: false,
dark: false,
info: false,
success: false,
warning: false,
danger: false
};
}
};
</script>
<template>
<IButtoncolor="primary"@click="primary = true"> Show Primary Modal </IButton>
<IModalv-model="primary"color="primary">
<template #header> Primary Modal </template>
<template #icon>
<IIconname="ink-check"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="secondary"@click="secondary = true"> Show Secondary Modal </IButton>
<IModalv-model="secondary"color="secondary">
<template #header> Secondary Modal </template>
<template #icon>
<IIconname="ink-check"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="light"@click="light = true"> Show Light Modal </IButton>
<IModalv-model="light"color="light">
<template #header> Light Modal </template>
<template #icon>
<IIconname="ink-check"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="dark"@click="dark = true"> Show Dark Modal </IButton>
<IModalv-model="dark"color="dark">
<template #header> Dark Modal </template>
<template #icon>
<IIconname="ink-check"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="info"@click="info = true"> Show Info Modal </IButton>
<IModalv-model="info"color="info">
<template #header> Info Modal </template>
<template #icon>
<IIconname="ink-info"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="success"@click="success = true"> Show Success Modal </IButton>
<IModalv-model="success"color="success">
<template #header> Success Modal </template>
<template #icon>
<IIconname="ink-check"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="warning"@click="warning = true"> Show Warning Modal </IButton>
<IModalv-model="warning"color="warning">
<template #header> Warning Modal </template>
<template #icon>
<IIconname="ink-warning"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButtoncolor="danger"@click="danger = true"> Show Danger Modal </IButton>
<IModalv-model="danger"color="danger">
<template #header> Danger Modal </template>
<template #icon>
<IIconname="ink-danger"size="lg" />
</template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
</template>
You're able to use the size property to control the size of your modals, using one of the available sizes: sm, md, and lg.
The default size is set to md.
Preview
Component.vue
<script>
exportdefault {
data() {
return {
sm: false,
md: false,
lg: false
};
}
};
</script>
<template>
<IButton@click="sm = true"> Show Small Modal </IButton>
<IModalv-model="sm"size="sm">
<template #header> Small Modal </template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButton@click="md = true"> Show Medium Modal </IButton>
<IModalv-model="md"size="md">
<template #header> Medium Modal </template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
<IButton@click="lg = true"> Show Large Modal </IButton>
<IModalv-model="lg"size="lg">
<template #header> Large Modal </template>
This is the modal body. Useful information goes here.
<template #footer> Modal Footer </template>
</IModal>
</template>