Panel: Support custom 'near' Panel
hi, I need to set the styling on Panel so that it slides in from the left side. IPanelStyleProps has a property called isOnRightSide that I believe would do it. But I can't figure out how to implement it. Can someone provide an example please?
Have you tried using <Panel type={PanelType.smallFixedNear} ... />? That panel type is positioned on the left side of the screen. It's the second example in the documentation.
yes, but I need custom width, and the only option for custom width is sliding from the right side. And in general I find this interface that's used for Styles on a lot of components quite confusing: IStyleFunctionOrObject<IPanelStyleProps, IPanelStyles>
can't figure out how to use it. how would one create a simple object that implements IPanelStyleProps and set a property like isOnRightSide?
Appreciate your help :)
Yeah, looks like custom is on the 'far' side. We'd need to change the component to be able to support this. We probably need a customNear type, since supporting every 'type' with 'near/far' is probably a large refactor.
what would you say is the better way to make the smallfixednear type a bit wider?
Ok, without a major rewrite of a bunch of panel innards I'd say a customNear is the best approach. You could easily put a regular 'custom' on the left hand side...but the drop shadow would be wrong
could you explain how, please?
I'm sorry...I went stream of thoughts there for a bit. My answer is that we are missing this functionality right now. I've marked this as a level 2 feature request and will put it in our backlog. If you are interested in tackling this work sooner, I'd be happy to give you a hand.
I set some css to override-
.root-59 .main-103 {
width: 500px;
}
But it's a bit janky as the animation isn't smooth. A proper fix would be great.
I had the same issue and I resolved using PanelType.smallFixedNear and setting styles property to
{ main: { width: '500px !important' } }
You must work only on the media queries
similar to #6658 i think panel needs to be split into a generic container and the Panel as it is today. This will allow the underlined panel base to support any position while the Panel control will contain styles required to support positions described in our style guide.
closing this as it's tracked in #7625