Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to render Frame as anything other than <div> #592

Open
andria-dev opened this issue Dec 31, 2020 · 0 comments
Open

Ability to render Frame as anything other than <div> #592

andria-dev opened this issue Dec 31, 2020 · 0 comments

Comments

@andria-dev
Copy link

andria-dev commented Dec 31, 2020

With the Framer API, it appears that there isn't a way to render something like <header>, <figure>, or any other semantic HTML elements with <Frame> — this is likely not limited to just <Frame>. This means that using the Framer API on the web is very limited; to maintain accessibility on a website you would not be able to use <Frame> in specific parts of the code.

Here is an example that is taken straight from the "Examples" section of the documentation:

<Frame size={150} background={"#fff"} radius={30} />

The above code would render a <div> in HTML like so:

<div
  data-framer-component-type="Frame"
  size="150"
  style="display: block; flex-shrink: 0; user-select: none; pointer-events: none; height: 150px; width: 150px; border-radius: 30px; background: rgb(255, 255, 255); transform: none;"
>
</div>

Solution

What I'm proposing is that — to allow semantic HTML elements to be used, a necessity for accessibility on the web — an as prop would be added for any component that can currently only render a <div>; the as prop has become quite commonplace in the React community.

<Frame as="header" size={150} background={"#fff"} radius={30} />
<Frame as="section" size={150} background={"#fff"} radius={30} />
<Frame as="figure" size={150} background={"#fff"} radius={30} />
<Frame as={WhateverComponentOrHtmlTagYouWant} size={150} background={"#fff"} radius={30} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant