diff --git a/code/addons/viewport/src/Tool.tsx b/code/addons/viewport/src/Tool.tsx index dd321b637cf9..ab07949a8afe 100644 --- a/code/addons/viewport/src/Tool.tsx +++ b/code/addons/viewport/src/Tool.tsx @@ -127,12 +127,13 @@ export const ViewportTool: FC = memo( withTheme(({ theme }: { theme: Theme }) => { const { viewports = MINIMAL_VIEWPORTS, + defaultOrientation = 'portrait', defaultViewport = responsiveViewport.id, disable, } = useParameter(PARAM_KEY, {}); const [state, setState] = useAddonState(ADDON_ID, { selected: defaultViewport, - isRotated: false, + isRotated: defaultOrientation === 'landscape', }); const list = toList(viewports); diff --git a/code/addons/viewport/src/models/ViewportAddonParameter.ts b/code/addons/viewport/src/models/ViewportAddonParameter.ts index 190e2beae0ec..875ca46fbc7d 100644 --- a/code/addons/viewport/src/models/ViewportAddonParameter.ts +++ b/code/addons/viewport/src/models/ViewportAddonParameter.ts @@ -2,6 +2,7 @@ import type { ViewportMap } from './Viewport'; export interface ViewportAddonParameter { disable?: boolean; + defaultOrientation?: 'portrait' | 'landscape'; defaultViewport?: string; viewports?: ViewportMap; }