Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to Switch Between Duotone, Solid, and Outline Icon Styles Programmatically

Hi Keenthemes team, I'm currently using your template and implementing icons in my navigation configuration like this:

export const MENU_ROOT: TMenuConfig = [
  {
    title: 'Profile',
    icon: 'abstract-27',
    path: 'https://www.aman.com/zh-cn/resorts/aman-kyoto',
  },
  {
    title: 'Account',
    icon: 'setting-2',
    rootPath: '/account/',
    path: '/',
  },
  {
    title: 'Network',
    icon: 'users',
    rootPath: '/network/',
    path: 'network/get-started',
  },
  {
    title: 'Authentication',
    icon: 'security-user',
    rootPath: '/authentication/',
    path: 'authentication/get-started',
  }
];

I notice that the template provides icons in three different styles: Duotone, Solid, and Outline. However, I'm unable to figure out how to specify which style I want to use for a particular icon. Could you please provide guidance on:

  1. How to programmatically switch between these three styles?
  2. Is there a specific property or modifier I need to add to my configuration to specify the icon style?
  3. Are there any code examples showing how to implement different icon styles in the navigation configuration?

Thank you for your help! Best regards

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


I find it


<KeenIcon icon={item.icon} style="solid" />


thx



Hi,

The default icon style you can change here: "src/config/settings.config.ts"

To change the icon style programmitcally please use


// refer: src/components/keenicons/types.d.ts
const { settings, updateSettings } = useSettings();
updateSettings({ keeniconsStyle: "outline" });


Regards,
Sean


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(