Closed clearlysid closed 5 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
radix-icons | ❌ Failed (Inspect) | Aug 7, 2023 3:02pm |
The HOC is extremely simple, here's the code one can use in Framer to get this component in their project directly:
import * as Radix from "@radix-ui/react-icons"
import { addPropertyControls, ControlType } from "framer"
let iconsList = Object.keys(Radix)
/*
* @framerSupportedLayoutWidth any-prefer-fixed
* @framerSupportedLayoutHeight any-prefer-fixed
* @framerIntrinsicHeight 24
* @framerIntrinsicWidth 24
*/
export default function RadixIcon(props) {
const IconComponent = Radix[props.icon]
return <IconComponent style={{ ...props.style, color: props.color }} />
}
addPropertyControls(RadixIcon, {
icon: {
type: ControlType.Enum,
defaultValue: "FramerLogoIcon",
displaySegmentedControl: false,
options: iconsList,
},
color: {
type: ControlType.Color,
defaultValue: "#FF007C",
},
})
👋 Hello, thanks for the lovely icons!
I was using them in a project and needed an easy way to use them within Framer. Ended up writing a small HOC that can be pasted into Framer, allows changing the dimensions, picking a colour and selecting any icon from the list.
Made this quick PR to add it under the "Assets" section of the website, in case it might come in handy for others. Adding a small GIF to show how it works.
PR checklist:
(No changes that would affect the below)
width="15" height="15" viewBox="0 0 15 15"
stroke
clip-path