How to use @chakra-ui/core - 10 common examples

To help you get started, weโ€™ve selected a few @chakra-ui/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github minskylab / supersense / observer / components / atoms / eventCard / index.tsx View on Github external
setTimeAgo(format(event.emittedAt, "en_US"));
        }, 1000);

        return () => {
            window.clearInterval(timer);
        };
    }, []);

    const eventKindToTitle = (eventKind: string): string => {
        eventKind[0].toUpperCase();
        const sPart = eventKind.substring(1).replace(/-/g, " ");
        return eventKind.substring(0, 1).toUpperCase() + sPart;
    };

    const borderColor = useColorModeValue(theme.colors.gray["900"], theme.colors.gray["600"]);
    const highLightColor = useColorModeValue(theme.colors.gray["50"], theme.colors.gray["700"]);

    return (
github minskylab / supersense / observer / components / atoms / eventCard / index.tsx View on Github external
const timer = setInterval(() => {
            setTimeAgo(format(event.emittedAt, "en_US"));
        }, 1000);

        return () => {
            window.clearInterval(timer);
        };
    }, []);

    const eventKindToTitle = (eventKind: string): string => {
        eventKind[0].toUpperCase();
        const sPart = eventKind.substring(1).replace(/-/g, " ");
        return eventKind.substring(0, 1).toUpperCase() + sPart;
    };

    const borderColor = useColorModeValue(theme.colors.gray["900"], theme.colors.gray["600"]);
    const highLightColor = useColorModeValue(theme.colors.gray["50"], theme.colors.gray["700"]);

    return (
github minskylab / supersense / observer / components / atoms / header / index.tsx View on Github external
const Header: FC = ({
    initialTitle,
    hashtag,
    onSettings,
    brand = "SUPERSENSE",
    lightColor = "teal.200",
    darkColor = "teal.700",
}: HeaderProps) => {
    const { colorMode, toggleColorMode } = useColorMode();

    const bgColor = useColorModeValue(lightColor, darkColor);

    const changeColorModeIcon = useColorModeValue(
        ,
        
    );

    return (
github minskylab / supersense / observer / components / atoms / header / index.tsx View on Github external
const Header: FC = ({
    initialTitle,
    hashtag,
    onSettings,
    brand = "SUPERSENSE",
    lightColor = "teal.200",
    darkColor = "teal.700",
}: HeaderProps) => {
    const { colorMode, toggleColorMode } = useColorMode();

    const bgColor = useColorModeValue(lightColor, darkColor);

    const changeColorModeIcon = useColorModeValue(
        ,
        
    );

    return (
github checktheroads / hyperglass / hyperglass / ui / components / Table / TableRow.js View on Github external
const TableRow = ({
  highlight = false,
  highlightBg = "primary",
  doStripe = false,
  doHorizontalBorders = false,
  index = 0,
  children = false,
  ...props
}) => {
  const { colorMode } = useColorMode();
  const theme = useTheme();

  let bg = null;
  if (highlight) {
    bg = `${highlightBg}.${alphaMap[colorMode]}`;
  } else if (doStripe && index % 2 !== 0) {
    bg = bgStripe[colorMode];
  }
  const color = highlight ? opposingColor(theme, bg) : null;

  const borderProps =
    doHorizontalBorders && index !== 0 ? rowBorder[colorMode] : {};
  return (
github checktheroads / hyperglass / hyperglass / ui / components / Result.js View on Github external
(
    {
      device,
      timeout,
      queryLocation,
      queryType,
      queryVrf,
      queryTarget,
      index,
      resultsComplete,
      setComplete
    },
    ref
  ) => {
    const config = useConfig();
    const theme = useTheme();
    const { isSm } = useMedia();
    const { colorMode } = useColorMode();
    let [{ data, loading, error }, refetch] = useAxios({
      url: "/api/query/",
      method: "post",
      data: {
        query_location: queryLocation,
        query_type: queryType,
        query_vrf: queryVrf,
        query_target: queryTarget
      },
      timeout: timeout,
      useCache: false
    });

    const [isOpen, setOpen] = useState(false);
github checktheroads / hyperglass / hyperglass / ui / components / Meta.js View on Github external
const Meta = () => {
  const config = useConfig();
  const theme = useTheme();
  const [location, setLocation] = useState({});
  const title = config?.site_title || "hyperglass";
  const description = config?.site_description || "The modern looking glass.";
  const siteName = `${title} - ${description}`;
  const keywords = config?.site_keywords || [
    "hyperglass",
    "looking glass",
    "lg",
    "peer",
    "peering",
    "ipv4",
    "ipv6",
    "transit",
    "community",
    "communities",
    "bgp",
github checktheroads / hyperglass / hyperglass / ui / components / Table / TableMain.js View on Github external
const MainTable = ({ children, ...props }) => {
  const theme = useTheme();
  const { colorMode } = useColorMode();
  return (
github minskylab / supersense / observer / components / atoms / eventCard / index.tsx View on Github external
const EventCard: React.FC = ({ event }: EventCardProps) => {
    const [timeAgo, setTimeAgo] = useState(format(event.emittedAt, "en_US"));
    const props = useSpring({ opacity: 1, from: { opacity: 0 } });
    const theme = useTheme();

    useEffect(() => {
        const timer = setInterval(() => {
            setTimeAgo(format(event.emittedAt, "en_US"));
        }, 1000);

        return () => {
            window.clearInterval(timer);
        };
    }, []);

    const eventKindToTitle = (eventKind: string): string => {
        eventKind[0].toUpperCase();
        const sPart = eventKind.substring(1).replace(/-/g, " ");
        return eventKind.substring(0, 1).toUpperCase() + sPart;
    };
github checktheroads / hyperglass / hyperglass / ui / components / Results.js View on Github external
const Results = ({
  queryLocation,
  queryType,
  queryVrf,
  queryTarget,
  setSubmitting,
  ...props
}) => {
  const config = useConfig();
  const theme = useTheme();
  const { mediaSize } = useMedia();
  const matchedVrf =
    config.vrfs.filter(v => v.id === queryVrf)[0] ??
    config.vrfs.filter(v => v.id === "default")[0];
  const [resultsComplete, setComplete] = useState(null);
  return (
    <>