With React Spectrum, how do I correctly fill the page background? #7255
-
I'm following the getting started guide, so my code looks like this: function App() {
return (
(
<Provider theme={defaultTheme}>
<Button
variant="accent"
onPress={() => alert('Hey there!')}
>
Hello, React Spectrum!
</Button>
</Provider>
)
); Out of the box, this creates an ugly partially-filled background: I can sort of fix that by setting Screen.Recording.2024-10-24.at.8.03.59.PM.mov |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Setting the body background color to the same color as the app div should work. |
Beta Was this translation helpful? Give feedback.
-
Are you trying to use React Spectrum to build a new Adobe app? Otherwise you can do something like https://codesandbox.io/p/sandbox/zk5sfz I know it's a little clunky, it'll be easier in S2, but I don't know if you can use that yet. |
Beta Was this translation helpful? Give feedback.
Are you trying to use React Spectrum to build a new Adobe app?
If this is a non-Adobe/Adobe-themed app, then you can do it any way you like using RAC instead https://react-spectrum.adobe.com/react-aria/index.html as it's bring your own styles.
Otherwise you can do something like https://codesandbox.io/p/sandbox/zk5sfz
I know it's a little clunky, it'll be easier in S2, but I don't know if you can use that yet.