Use Iconify custom fieldtype
Storyblok is the first headless CMS that works for developers & marketers alike.
Introduction
If you want to create attractive websites or applications, Iconify and Storyblok custom field-type are two valuable tools that can help. Iconify makes it easy to add custom icons to your project, while Storyblok custom field-type allows you to manage and display your content in a flexible way. In this article, we'll explain how you can use both Iconify and Storyblok custom field-type.
Create Iconify plugin
Let’s start with the plugin, go to My Plugins
.
Create a new field-type by clicking on + New Field type
on top right and give a name : Iconify.
On save, you will access the editor, you should have the same screen as below :
Copy and paste code this code into the dedicated space :
Click on save, you should have the view updated :
You can test it, enter in the Field-type Preview a word, brand whatever you think, and check what you get.
If you are good with it, click on Publish
.
Congratulations on creating your first Iconify Field-type plugin!
Create an Astro project
Use your Astro project or you can use this starter I made: https://github.com/jpkha/astro-storyblok-starter.
Install astro-iconify
(https://github.com/manuelmeister/astro-iconify) instead of the official astro-icon
.
With the latest, there is some issue with some Iconify Icon, it’s a known issue: https://github.com/natemoo-re/astro-icon/issues/29
Write the code below in the feature.astro
file :
Depending on the icon you choose, from the code you can set the size, the color for example. Here I choose to display my icon in height and width 100px and color in indigo.
Let’s use the plugin and display icon in Astro project
Launch your Astro app and go to your Storyblok App.
You should have like below and now you can enjoy and choose an icon:
Now you can choose whatever Icon and get the icon in your Astro project.
You should have something similar :
Wrapping Up
In summary, Iconify and Storyblok custom field-type are useful tools for developers to create visually appealing websites and applications. By adding customizable icons with Iconify and using Storyblok custom field-type to manage content, developers can create engaging user experiences. These tools offer flexibility and ease of use for stunning designs without extensive coding knowledge. With Iconify and Storyblok custom field-type, developers can enhance their projects and impress users with visually stunning content.