diff --git a/packages/grafana-ui/src/components/Icon/Icon.story.tsx b/packages/grafana-ui/src/components/Icon/Icon.story.tsx
index 3fc4d882c72..cc1954f4a97 100644
--- a/packages/grafana-ui/src/components/Icon/Icon.story.tsx
+++ b/packages/grafana-ui/src/components/Icon/Icon.story.tsx
@@ -1,6 +1,7 @@
-import React from 'react';
+import React, { ChangeEvent, useState } from 'react';
import { css } from 'emotion';
+import { Forms } from '../index';
import { Icon } from './Icon';
import { getAvailableIcons, IconType } from './types';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
@@ -32,8 +33,6 @@ const IconWrapper: React.FC<{ name: IconType }> = ({ name }) => {
= ({ name }) => {
);
};
-export const simple = () => {
- const icons = getAvailableIcons();
- const iconsPerRow = 10;
- const rows: IconType[][] = [[]];
- let rowIdx = 0;
+const icons = getAvailableIcons().sort((a, b) => a.localeCompare(b));
- icons.forEach((i: IconType, idx: number) => {
- if (idx % iconsPerRow === 0) {
- rows.push([]);
- rowIdx++;
- }
- rows[rowIdx].push(i);
- });
+export const simple = () => {
+ const [filter, setFilter] = useState('');
+
+ const searchIcon = (event: ChangeEvent
) => {
+ setFilter(event.target.value);
+ };
return (
- {rows.map(r => {
- return (
-
- {r.map((i, index) => {
- return ;
- })}
-
- );
- })}
+
+
+
+
+ {icons
+ .filter(val => val.includes(filter))
+ .map(i => {
+ return ;
+ })}
+
);
};